From 6b49d22ada830b43c94260678a31eca8769de4b6 Mon Sep 17 00:00:00 2001 From: Miles Granger Date: Tue, 23 Aug 2022 11:07:00 +0200 Subject: [PATCH] Test Codec compression_level attr --- python/pyarrow/tests/test_io.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/pyarrow/tests/test_io.py b/python/pyarrow/tests/test_io.py index ca49c5218e88b..a6488d70df53e 100644 --- a/python/pyarrow/tests/test_io.py +++ b/python/pyarrow/tests/test_io.py @@ -719,6 +719,12 @@ def test_compression_level(compression): if not Codec.is_available(compression): pytest.skip("{} support is not built".format(compression)) + codec = Codec(compression) + if codec.name == "snappy": + assert codec.compression_level is None + else: + assert isinstance(codec.compression_level, int) + # These codecs do not support a compression level no_level = ['snappy'] if compression in no_level: