Skip to content

Commit fce608f

Browse files
committed
preserve order of snapshots by changing response to a list instead of set
1 parent 6ef1aa2 commit fce608f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pyiceberg/table/update/validate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def validation_history(
2727
to_snapshot: Snapshot,
2828
matching_operations: set[Operation],
2929
manifest_content_filter: ManifestContent,
30-
) -> tuple[list[ManifestFile], set[Snapshot]]:
30+
) -> tuple[list[ManifestFile], list[Snapshot]]:
3131
"""Return newly added manifests and snapshot IDs between the starting snapshot and parent snapshot.
3232
3333
Args:
@@ -44,7 +44,7 @@ def validation_history(
4444
List of manifest files and set of snapshots matching conditions
4545
"""
4646
manifests_files: list[ManifestFile] = []
47-
snapshots: set[Snapshot] = set()
47+
snapshots: list[Snapshot] = []
4848

4949
last_snapshot = None
5050
for snapshot in ancestors_between(from_snapshot, to_snapshot, table.metadata):
@@ -57,7 +57,8 @@ def validation_history(
5757
if operation not in matching_operations:
5858
continue
5959

60-
snapshots.add(snapshot)
60+
if snapshot not in snapshots:
61+
snapshots.append(snapshot)
6162
manifests_files.extend(
6263
[
6364
manifest

0 commit comments

Comments
 (0)