chinmay-bhat commented on code in PR #748: URL: https://github.com/apache/iceberg-python/pull/748#discussion_r1622176755
########## pyiceberg/table/__init__.py: ########## @@ -1290,6 +1291,19 @@ def snapshot_by_name(self, name: str) -> Optional[Snapshot]: return self.snapshot_by_id(ref.snapshot_id) return None + def latest_snapshot_before_timestamp(self, timestamp_ms: int) -> Optional[Snapshot]: + """Get the snapshot right before the given timestamp, or None if there is no matching snapshot.""" + result, prev_timestamp = None, 0 + if self.metadata.current_snapshot_id is not None: + for snapshot in self.current_ancestors(): + if snapshot and prev_timestamp < snapshot.timestamp_ms < timestamp_ms: Review Comment: updated to use inclusive parameter! -- 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