Fokko commented on code in PR #728:
URL: https://github.com/apache/iceberg-python/pull/728#discussion_r1624081189
##########
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:
I don't think these are needed. We should just check the branches/tags that
are set. Which should come from `_set_ref_snapshot`.
--
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]