ForeverAngry commented on code in PR #1880:
URL: https://github.com/apache/iceberg-python/pull/1880#discussion_r2053172440
##########
pyiceberg/table/update/snapshot.py:
##########
@@ -843,3 +849,52 @@ def remove_branch(self, branch_name: str) ->
ManageSnapshots:
This for method chaining
"""
return self._remove_ref_snapshot(ref_name=branch_name)
+
+ def _commit(self) -> UpdatesAndRequirements:
+ """
+ Commit the staged updates and requirements.
+ This will remove the snapshots with the given IDs.
+
+ Returns:
+ Tuple of updates and requirements to be committed,
+ as required by the calling parent apply functions.
+ """
+ update =
RemoveSnapshotsUpdate(snapshot_ids=self._snapshot_ids_to_expire)
+ self._updates += (update,)
+ return self._updates, self._requirements
Review Comment:
@kevinjqliu what do you think of this approach, and creating a class for
ExpireSnapshots, instead of including it in the ManageSnapshots class?
--
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]