Fokko commented on code in PR #211:
URL: https://github.com/apache/iceberg-python/pull/211#discussion_r1424978509


##########
pyiceberg/table/__init__.py:
##########
@@ -944,8 +944,8 @@ def snapshot(self) -> Optional[Snapshot]:
     def projection(self) -> Schema:
         snapshot_schema = self.table.schema()
         if snapshot := self.snapshot():
-            if snapshot_schema_id := snapshot.schema_id:
-                snapshot_schema = self.table.schemas()[snapshot_schema_id]
+            snapshot_schema_id = snapshot.schema_id
+            snapshot_schema = self.table.schemas()[snapshot_schema_id]

Review Comment:
   Thanks for opening this PR @tonyps1223!
   
   The schema-id on the snapshot is 
[optional](https://iceberg.apache.org/spec/#snapshots), I think we still need 
to check if it is non-null, but make sure that we still pass on `0`:
   ```suggestion
               if snapshot.schema_id is not None:
                   snapshot_schema = self.table.schemas()[snapshot.schema_id]
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to