@@ -104,8 +104,7 @@ def expire_snapshots_older_than(self, timestamp_ms: int) -> None:
104104 snapshots_to_expire .append (snapshot .snapshot_id )
105105
106106 if snapshots_to_expire :
107- with self .tbl .transaction ():
108- self .expire_snapshots_by_ids (snapshots_to_expire )
107+ self .expire_snapshots_by_ids (snapshots_to_expire )
109108
110109 def expire_snapshots_older_than_with_retention (
111110 self , timestamp_ms : int , retain_last_n : Optional [int ] = None , min_snapshots_to_keep : Optional [int ] = None
@@ -122,8 +121,7 @@ def expire_snapshots_older_than_with_retention(
122121 )
123122
124123 if snapshots_to_expire :
125- with self .tbl .transaction ():
126- self .expire_snapshots_by_ids (snapshots_to_expire )
124+ self .expire_snapshots_by_ids (snapshots_to_expire )
127125
128126 def retain_last_n_snapshots (self , n : int ) -> None :
129127 """Keep only the last N snapshots, expiring all others.
@@ -158,8 +156,7 @@ def retain_last_n_snapshots(self, n: int) -> None:
158156 snapshots_to_expire .append (snapshot .snapshot_id )
159157
160158 if snapshots_to_expire :
161- with self .tbl .transaction ():
162- self .expire_snapshots_by_ids (snapshots_to_expire )
159+ self .expire_snapshots_by_ids (snapshots_to_expire )
163160
164161 def _get_snapshots_to_expire_with_retention (
165162 self , timestamp_ms : Optional [int ] = None , retain_last_n : Optional [int ] = None , min_snapshots_to_keep : Optional [int ] = None
@@ -215,7 +212,7 @@ def _get_snapshots_to_expire_with_retention(
215212
216213 def expire_snapshots_with_retention_policy (
217214 self , timestamp_ms : Optional [int ] = None , retain_last_n : Optional [int ] = None , min_snapshots_to_keep : Optional [int ] = None
218- ) -> List [ int ] :
215+ ) -> None :
219216 """Comprehensive snapshot expiration with multiple retention strategies.
220217
221218 This method provides a unified interface for snapshot expiration with various
@@ -265,12 +262,7 @@ def expire_snapshots_with_retention_policy(
265262 )
266263
267264 if snapshots_to_expire :
268- with self .tbl .transaction () as txn :
269- from pyiceberg .table .update import RemoveSnapshotsUpdate
270-
271- txn ._apply ((RemoveSnapshotsUpdate (snapshot_ids = snapshots_to_expire ),))
272-
273- return snapshots_to_expire
265+ self .expire_snapshots_by_ids (snapshots_to_expire )
274266
275267 def _get_protected_snapshot_ids (self , table_metadata : TableMetadata ) -> Set [int ]:
276268 """Get the IDs of protected snapshots.
0 commit comments