From a733c0d5fedac8de0a3f931bfcfe673bba997678 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 15 Jun 2020 18:25:09 +0200 Subject: [PATCH] Backport PR #34804 on branch 1.0.x (TST: ensure read_parquet filter argument is correctly passed though (pyarrow engine)) --- pandas/tests/io/test_parquet.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 853b4e754bcd0..0b883e2bd142f 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -591,6 +591,17 @@ def test_additional_extension_types(self, pa): ) check_round_trip(df, pa) + @td.skip_if_no("pyarrow", min_version="0.17") + def test_filter_row_groups(self, pa): + # https://github.com/pandas-dev/pandas/issues/26551 + df = pd.DataFrame({"a": list(range(0, 3))}) + with tm.ensure_clean() as path: + df.to_parquet(path, pa) + result = read_parquet( + path, pa, filters=[("a", "==", 0)], use_legacy_dataset=False + ) + assert len(result) == 1 + class TestParquetFastParquet(Base): @td.skip_if_no("fastparquet", min_version="0.3.2")