From 528754c57d2e4b489df6e66e7a3327ed4a04e16f Mon Sep 17 00:00:00 2001 From: cclauss Date: Wed, 4 Jul 2018 13:21:24 +0200 Subject: [PATCH] [BEAM-1251] Upgrade from buffer to memoryview (again) --- sdks/python/apache_beam/io/avroio.py | 4 ++-- sdks/python/container/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdks/python/apache_beam/io/avroio.py b/sdks/python/apache_beam/io/avroio.py index 1368734f17d3..bee8ab860b12 100644 --- a/sdks/python/apache_beam/io/avroio.py +++ b/sdks/python/apache_beam/io/avroio.py @@ -339,8 +339,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(cStringIO.StringIO(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" && \