Skip to content

Commit c8d41df

Browse files
committed
add column projection test
1 parent c6b0f5f commit c8d41df

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/io/test_pyarrow.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,16 @@ def test_identity_transform_column_projection(tmp_path: str, catalog: InMemoryCa
11971197
},
11981198
schema=schema,
11991199
)
1200+
# Test that the partition value is projected correctly
1201+
assert table.scan(row_filter="partition_id = 1").to_arrow() == pa.table(
1202+
{
1203+
"other_field": ["foo", "bar", "baz"],
1204+
"partition_id": [1, 1, 1],
1205+
},
1206+
schema=schema,
1207+
)
1208+
# Test that the partition value is not projected for a non-existing partition
1209+
assert len(table.scan(row_filter="partition_id = -1").to_arrow()) == 0
12001210

12011211

12021212
def test_identity_transform_columns_projection(tmp_path: str, catalog: InMemoryCatalog) -> None:

0 commit comments

Comments
 (0)