@@ -885,25 +885,32 @@ def _commit(self) -> Tuple[Tuple[TableUpdate, ...], Tuple[TableRequirement, ...]
885885 if not self ._ids_to_remove :
886886 raise ValueError ("No snapshot IDs marked for expiration." )
887887
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 )} " )
888891 # Ensure current snapshots in refs are not marked for removal
889892 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 } " )
890895 conflicting_ids = self ._ids_to_remove .intersection (current_snapshot_ids )
896+ print (f"Conflicting snapshot IDs: { conflicting_ids } " )
897+
891898 if conflicting_ids :
892899 # Remove references to the conflicting snapshots before expiring them
893900 for ref_name , ref in list (self ._transaction .table_metadata .refs .items ()):
894901 if ref .snapshot_id in conflicting_ids :
895902 self ._updates += (RemoveSnapshotRefUpdate (ref_name = ref_name ),)
896903
897904 # Remove the snapshots
898- updates = (RemoveSnapshotsUpdate (snapshot_ids = list (self ._ids_to_remove )),)
905+ self . _updates = (RemoveSnapshotsUpdate (snapshot_ids = list (self ._ids_to_remove )),)
899906
900907 # Ensure refs haven't changed (snapshot ID consistency check)
901908 requirements = tuple (
902909 AssertRefSnapshotId (snapshot_id = ref .snapshot_id , ref = ref_name )
903910 for ref_name , ref in self ._transaction .table_metadata .refs .items ()
904911 if ref .snapshot_id not in self ._ids_to_remove
905912 )
906- self . _updates += updates
913+
907914 self ._requirements += requirements
908915 return self ._updates , self ._requirements
909916
0 commit comments