Skip to content

Commit 22dc741

Browse files
nameexhaustionritchie46
authored andcommitted
test(python): Update test for latest pyiceberg (#29090)
(cherry picked from commit 24dc47e)
1 parent d1a325b commit 22dc741

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎py-polars/tests/unit/io/test_iceberg.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,10 +2083,12 @@ def test_scan_iceberg_nulls_nested(tmp_path: Path) -> None:
20832083

20842084

20852085
@pytest.mark.write_disk
2086+
@pytest.mark.parametrize("use_pyiceberg_filter", [True, False])
20862087
def test_scan_iceberg_parquet_prefilter_with_column_mapping(
20872088
tmp_path: Path,
20882089
plmonkeypatch: PlMonkeyPatch,
20892090
capfd: pytest.CaptureFixture[str],
2091+
use_pyiceberg_filter: bool,
20902092
) -> None:
20912093
catalog = SqlCatalog(
20922094
"default",
@@ -2159,14 +2161,8 @@ def test_scan_iceberg_parquet_prefilter_with_column_mapping(
21592161
),
21602162
)
21612163

2162-
# Upstream issue - PyIceberg filter does not handle schema evolution
2163-
with pytest.raises(Exception, match="unpack requires a buffer of 8 bytes"):
2164-
pl.scan_iceberg(
2165-
tbl, reader_override="native", use_pyiceberg_filter=True
2166-
).filter(pl.col("column_3") == 5).collect()
2167-
21682164
q = pl.scan_iceberg(
2169-
tbl, reader_override="native", use_pyiceberg_filter=False
2165+
tbl, reader_override="native", use_pyiceberg_filter=use_pyiceberg_filter
21702166
).filter(pl.col("column_3") == 5)
21712167

21722168
with plmonkeypatch.context() as cx:
@@ -2186,6 +2182,11 @@ def test_scan_iceberg_parquet_prefilter_with_column_mapping(
21862182
),
21872183
)
21882184

2185+
if use_pyiceberg_filter:
2186+
# Skipped from pyiceberg, we don't see the file at all.
2187+
assert "[MultiScanTaskInit]: 1 source" in capture
2188+
return
2189+
21892190
# First file
21902191
assert "Source filter mask initialization via table statistics" in capture
21912192
assert "Predicate pushdown allows skipping 1 / 2 files" in capture

0 commit comments

Comments
 (0)