diff --git a/py-polars/tests/unit/io/test_parquet.py b/py-polars/tests/unit/io/test_parquet.py index 71061fa6a4d5..fc61afe0d337 100644 --- a/py-polars/tests/unit/io/test_parquet.py +++ b/py-polars/tests/unit/io/test_parquet.py @@ -2710,3 +2710,22 @@ def test_boolean_slice_pushdown_20314() -> None: f.seek(0) assert pl.scan_parquet(f).slice(2, 1).collect().item() + + +def test_allow_missing_columns_predicate_pushdown_20361() -> None: + f1 = io.BytesIO() + f2 = io.BytesIO() + + pl.DataFrame({"a": [1], "b": [1]}).write_parquet(f1) + pl.DataFrame({"a": [1]}).write_parquet(f2) + + f1.seek(0) + f2.seek(0) + + df = ( + pl.scan_parquet([f1, f2], allow_missing_columns=True) # type: ignore[arg-type] + .filter(pl.col.a == pl.col.b) + .collect() + ) + + assert_frame_equal(df, pl.DataFrame({"a": [1, 1], "b": [1, None]}))