HonahX commented on code in PR #748: URL: https://github.com/apache/iceberg-python/pull/748#discussion_r1621869633
########## pyiceberg/table/__init__.py: ########## @@ -1290,6 +1291,17 @@ def snapshot_by_name(self, name: str) -> Optional[Snapshot]: return self.snapshot_by_id(ref.snapshot_id) return None + def snapshot_at_or_before_timestamp(self, timestamp_ms: int) -> Optional[Snapshot]: + """Get the snapshot that was current at or right before the given timestamp, or None if there is no matching snapshot.""" + for log_entry in reversed(self.history()): + if log_entry.timestamp_ms <= timestamp_ms: + return self.snapshot_by_id(log_entry.snapshot_id) + return None + + def current_ancestors(self) -> Iterable[Snapshot]: + """Get a list of ancestors of and including the current snapshot.""" + return ancestors_of(self.current_snapshot(), self.metadata) # type: ignore Review Comment: ```suggestion return ancestors_of(self.current_snapshot(), self.metadata) ``` I think we do not need this any more? -- 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