Skip to content

Commit 8597e16

Browse files
committed
fix case when parent_snapshot_id is 0
1 parent 3288d92 commit 8597e16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyiceberg/table/snapshots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,6 @@ def ancestors_of(current_snapshot: Snapshot, table_metadata: TableMetadata) -> I
423423
"""Get the ancestors of and including the given snapshot."""
424424
if current_snapshot:
425425
yield current_snapshot
426-
if current_snapshot.parent_snapshot_id:
426+
if current_snapshot.parent_snapshot_id is not None:
427427
if parent := table_metadata.snapshot_by_id(current_snapshot.parent_snapshot_id):
428428
yield from ancestors_of(parent, table_metadata)

0 commit comments

Comments
 (0)