amogh-jahagirdar commented on code in PR #247:
URL: https://github.com/apache/iceberg-python/pull/247#discussion_r1441260336
##########
pyiceberg/table/__init__.py:
##########
@@ -942,15 +942,16 @@ def snapshot(self) -> Optional[Snapshot]:
return self.table.current_snapshot()
def projection(self) -> Schema:
- snapshot_schema = self.table.schema()
- if snapshot := self.snapshot():
- if snapshot.schema_id is not None:
- snapshot_schema = self.table.schemas()[snapshot.schema_id]
+ current_schema = self.table.schema()
+ if self.snapshot_id is not None:
+ snapshot = self.table.snapshot_by_id(self.snapshot_id)
Review Comment:
I think the warning makes sense for the missing schema ID case but what
about the case where the snapshot_id is set but cannot be found (if line 948
returns `None`)? I think the only option there would be to throw because that
means there was some established snapshot_id but we can't find it anymore.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]