Fokko commented on code in PR #728:
URL: https://github.com/apache/iceberg-python/pull/728#discussion_r1624117267
##########
pyiceberg/table/__init__.py:
##########
@@ -1806,6 +1891,85 @@ def __enter__(self) -> U:
return self # type: ignore
+class ManageSnapshots(UpdateTableMetadata["ManageSnapshots"]):
+ """Run snapshot management operations using APIs."""
+
+ _updates: Tuple[TableUpdate, ...] = ()
+ _requirements: Tuple[TableRequirement, ...] = ()
+ _parent_snapshot_id: Optional[int]
+
+ def _commit(self) -> UpdatesAndRequirements:
+ """Apply the pending changes and commit."""
+ if self._updates:
+ self._requirements += (
+ AssertRefSnapshotId(snapshot_id=self._parent_snapshot_id,
ref="main"),
+
AssertTableUUID(uuid=self._transaction.table_metadata.table_uuid),
+ )
Review Comment:
Thanks, let's continue the discussion in that thread.
--
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]