@@ -104,8 +104,7 @@ def expire_snapshots_older_than(self, timestamp_ms: int) -> None:
104
104
snapshots_to_expire .append (snapshot .snapshot_id )
105
105
106
106
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 )
109
108
110
109
def expire_snapshots_older_than_with_retention (
111
110
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(
122
121
)
123
122
124
123
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 )
127
125
128
126
def retain_last_n_snapshots (self , n : int ) -> None :
129
127
"""Keep only the last N snapshots, expiring all others.
@@ -158,8 +156,7 @@ def retain_last_n_snapshots(self, n: int) -> None:
158
156
snapshots_to_expire .append (snapshot .snapshot_id )
159
157
160
158
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 )
163
160
164
161
def _get_snapshots_to_expire_with_retention (
165
162
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(
215
212
216
213
def expire_snapshots_with_retention_policy (
217
214
self , timestamp_ms : Optional [int ] = None , retain_last_n : Optional [int ] = None , min_snapshots_to_keep : Optional [int ] = None
218
- ) -> List [ int ] :
215
+ ) -> None :
219
216
"""Comprehensive snapshot expiration with multiple retention strategies.
220
217
221
218
This method provides a unified interface for snapshot expiration with various
@@ -265,12 +262,7 @@ def expire_snapshots_with_retention_policy(
265
262
)
266
263
267
264
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 )
274
266
275
267
def _get_protected_snapshot_ids (self , table_metadata : TableMetadata ) -> Set [int ]:
276
268
"""Get the IDs of protected snapshots.
0 commit comments