Skip to content

Commit aaa6994

Browse files
committed
test: cover all_files history when the current snapshot has no manifests
1 parent b394c5c commit aaa6994

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎tests/table/test_inspect.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ def test_inspect_files_of_snapshot_without_manifests(catalog: InMemoryCatalog, m
8484
assert getattr(tbl.inspect, method)() == tbl.inspect._get_files_schema().empty_table()
8585

8686

87+
def test_inspect_all_files_keeps_history_when_current_snapshot_has_no_manifests(catalog: InMemoryCatalog) -> None:
88+
tbl = catalog.create_table("default.overwritten_with_empty", Schema(NestedField(1, "x", LongType(), required=False)))
89+
tbl.append(pa.table({"x": pa.array([1], pa.int64())}))
90+
tbl.overwrite(pa.table({"x": pa.array([], pa.int64())}))
91+
92+
assert tbl.inspect.files().num_rows == 0
93+
assert tbl.inspect.all_files().num_rows == 1
94+
95+
8796
@pytest.mark.parametrize("newest_first", [False, True])
8897
def test_partitions_last_updated_uses_latest_snapshot_regardless_of_order(newest_first: bool) -> None:
8998
# Manifest entries are visited in manifest order, which is not chronological, so the

0 commit comments

Comments
 (0)