nssalian commented on code in PR #2879:
URL: https://github.com/apache/iceberg-python/pull/2879#discussion_r2706407434
##########
pyiceberg/table/update/snapshot.py:
##########
@@ -1008,6 +1009,26 @@ def rollback_to_snapshot(self, snapshot_id: int) ->
ManageSnapshots:
return self.set_current_snapshot(snapshot_id=snapshot_id)
+ def rollback_to_timestamp(self, timestamp_ms: int) -> ManageSnapshots:
Review Comment:
could add support for datetime too.
##########
pyiceberg/table/snapshots.py:
##########
@@ -472,3 +472,24 @@ def ancestors_between(from_snapshot: Snapshot | None,
to_snapshot: Snapshot, tab
break
else:
yield from ancestors_of(to_snapshot, table_metadata)
+
+
+def latest_ancestor_before_timestamp(table_metadata: TableMetadata,
timestamp_ms: int) -> Snapshot | None:
Review Comment:
I wonder if there is an edge case if the timestamp exactly matches a
snapshot's `timestamp_ms`.
Update: timestamp_ms: lookup snapshots before this timestamp
to
timestamp_ms: lookup snapshots strictly before this timestamp
--
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]