Skip to content

Commit 2bd8cf2

Browse files
Correctly handle schema-id == 0 from Snapshot (#211)
* fix snapshot schema issue: wrong usage of walrus operator * Update pyiceberg/table/__init__.py Co-authored-by: Fokko Driesprong <[email protected]> --------- Co-authored-by: Fokko Driesprong <[email protected]>
1 parent 3b5d3f3 commit 2bd8cf2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyiceberg/table/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,8 +944,8 @@ def snapshot(self) -> Optional[Snapshot]:
944944
def projection(self) -> Schema:
945945
snapshot_schema = self.table.schema()
946946
if snapshot := self.snapshot():
947-
if snapshot_schema_id := snapshot.schema_id:
948-
snapshot_schema = self.table.schemas()[snapshot_schema_id]
947+
if snapshot.schema_id is not None:
948+
snapshot_schema = self.table.schemas()[snapshot.schema_id]
949949

950950
if "*" in self.selected_fields:
951951
return snapshot_schema

0 commit comments

Comments
 (0)