diff --git a/sdks/python/apache_beam/io/avroio.py b/sdks/python/apache_beam/io/avroio.py index 9b86b58982b5..f90dc3c68330 100644 --- a/sdks/python/apache_beam/io/avroio.py +++ b/sdks/python/apache_beam/io/avroio.py @@ -341,8 +341,8 @@ def _decompress_bytes(data, codec): # Compressed data includes a 4-byte CRC32 checksum which we verify. # We take care to avoid extra copies of data while slicing large objects - # by use of a buffer. - result = snappy.decompress(buffer(data)[:-4]) + # by use of a memoryview. + result = snappy.decompress(memoryview(data)[:-4]) avroio.BinaryDecoder(io.BytesIO(data[-4:])).check_crc32(result) return result else: diff --git a/sdks/python/container/Dockerfile b/sdks/python/container/Dockerfile index 90348c6e231a..afb6b43f9382 100644 --- a/sdks/python/container/Dockerfile +++ b/sdks/python/container/Dockerfile @@ -70,7 +70,7 @@ RUN \ # Optional packages pip install "cython == 0.28.1" && \ pip install "guppy == 0.1.10" && \ - pip install "python-snappy == 0.5.1" && \ + pip install "python-snappy == 0.5.3" && \ # These are additional packages likely to be used by customers. pip install "numpy == 1.13.3" --no-binary=:all: && \ pip install "pandas == 0.18.1" && \