@@ -885,25 +885,32 @@ def _commit(self) -> Tuple[Tuple[TableUpdate, ...], Tuple[TableRequirement, ...]
885
885
if not self ._ids_to_remove :
886
886
raise ValueError ("No snapshot IDs marked for expiration." )
887
887
888
+
889
+ print (f"Totals number of snapshot IDs to expire: { len (self ._ids_to_remove )} " )
890
+ print (f"Total number of snapshots in the table: { len (self ._transaction .table_metadata .snapshots )} " )
888
891
# Ensure current snapshots in refs are not marked for removal
889
892
current_snapshot_ids = {ref .snapshot_id for ref in self ._transaction .table_metadata .refs .values ()}
893
+ print (f"Current snapshot IDs in refs: { current_snapshot_ids } " )
894
+ print (f"Snapshot IDs marked for removal: { self ._ids_to_remove } " )
890
895
conflicting_ids = self ._ids_to_remove .intersection (current_snapshot_ids )
896
+ print (f"Conflicting snapshot IDs: { conflicting_ids } " )
897
+
891
898
if conflicting_ids :
892
899
# Remove references to the conflicting snapshots before expiring them
893
900
for ref_name , ref in list (self ._transaction .table_metadata .refs .items ()):
894
901
if ref .snapshot_id in conflicting_ids :
895
902
self ._updates += (RemoveSnapshotRefUpdate (ref_name = ref_name ),)
896
903
897
904
# Remove the snapshots
898
- updates = (RemoveSnapshotsUpdate (snapshot_ids = list (self ._ids_to_remove )),)
905
+ self . _updates = (RemoveSnapshotsUpdate (snapshot_ids = list (self ._ids_to_remove )),)
899
906
900
907
# Ensure refs haven't changed (snapshot ID consistency check)
901
908
requirements = tuple (
902
909
AssertRefSnapshotId (snapshot_id = ref .snapshot_id , ref = ref_name )
903
910
for ref_name , ref in self ._transaction .table_metadata .refs .items ()
904
911
if ref .snapshot_id not in self ._ids_to_remove
905
912
)
906
- self . _updates += updates
913
+
907
914
self ._requirements += requirements
908
915
return self ._updates , self ._requirements
909
916
0 commit comments