@@ -663,7 +663,7 @@ def delete(
663663 self .table_metadata .properties .get (TableProperties .DELETE_MODE , TableProperties .DELETE_MODE_DEFAULT )
664664 == TableProperties .DELETE_MODE_MERGE_ON_READ
665665 ):
666- warnings .warn ("Merge on read is not yet supported, falling back to copy-on-write" )
666+ warnings .warn ("Merge on read is not yet supported, falling back to copy-on-write" , stacklevel = 2 )
667667
668668 if isinstance (delete_filter , str ):
669669 delete_filter = _parse_row_filter (delete_filter )
@@ -731,7 +731,7 @@ def delete(
731731 overwrite_snapshot .append_data_file (replaced_data_file )
732732
733733 if not delete_snapshot .files_affected and not delete_snapshot .rewrites_needed :
734- warnings .warn ("Delete operation did not match any records" )
734+ warnings .warn ("Delete operation did not match any records" , stacklevel = 2 )
735735
736736 def upsert (
737737 self ,
@@ -1502,7 +1502,7 @@ def _do_commit(self, updates: Tuple[TableUpdate, ...], requirements: Tuple[Table
15021502 try :
15031503 self .catalog ._delete_old_metadata (self .io , self .metadata , response .metadata )
15041504 except Exception as e :
1505- warnings .warn (f"Failed to delete old metadata after commit: { e } " )
1505+ warnings .warn (f"Failed to delete old metadata after commit: { e } " , stacklevel = 2 )
15061506
15071507 self .metadata = response .metadata
15081508 self .metadata_location = response .metadata_location
@@ -1728,7 +1728,7 @@ def projection(self) -> Schema:
17281728 schema for schema in self .table_metadata .schemas if schema .schema_id == snapshot .schema_id
17291729 )
17301730 except StopIteration :
1731- warnings .warn (f"Metadata does not contain schema with id: { snapshot .schema_id } " )
1731+ warnings .warn (f"Metadata does not contain schema with id: { snapshot .schema_id } " , stacklevel = 2 )
17321732 else :
17331733 raise ValueError (f"Snapshot not found: { self .snapshot_id } " )
17341734
0 commit comments