Skip to content

Commit aeca168

Browse files
author
Sreesh Maheshwar
committed
Test limit on an append scan also
1 parent 99021cc commit aeca168

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/integration/test_reads.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,21 @@ def test_incremental_append_scan_selected_fields(catalog: Catalog) -> None:
11031103
assert sorted(result_table["number"].to_pylist()) == [2, 3, 4]
11041104

11051105

1106+
@pytest.mark.integration
1107+
@pytest.mark.parametrize("catalog", [pytest.lazy_fixture("session_catalog_hive"), pytest.lazy_fixture("session_catalog")])
1108+
def test_incremental_append_scan_limit(catalog: Catalog) -> None:
1109+
test_table = catalog.load_table("default.test_incremental_read")
1110+
1111+
scan = (
1112+
test_table.incremental_append_scan(limit=2)
1113+
.from_snapshot_exclusive(test_table.snapshots()[0].snapshot_id)
1114+
.to_snapshot_inclusive(test_table.snapshots()[2].snapshot_id)
1115+
)
1116+
1117+
# Although three rows were added in the range, the limit of 2 should be applied
1118+
assert len(scan.to_arrow()) == 2
1119+
1120+
11061121
@pytest.mark.integration
11071122
@pytest.mark.parametrize("catalog", [pytest.lazy_fixture("session_catalog_hive")])
11081123
def test_incremental_append_scan_to_snapshot_defaults_to_current(catalog: Catalog) -> None:

0 commit comments

Comments
 (0)