@@ -228,8 +228,6 @@ def _summary(self, snapshot_properties: dict[str, str] = EMPTY_DICT) -> Summary:
228228
229229 # avoid copying metadata for each data file
230230 table_metadata = self ._transaction .table_metadata
231- schema = table_metadata .schema ()
232- default_spec = table_metadata .spec ()
233231
234232 partition_summary_limit = int (
235233 table_metadata .properties .get (
@@ -241,8 +239,8 @@ def _summary(self, snapshot_properties: dict[str, str] = EMPTY_DICT) -> Summary:
241239 for data_file in self ._added_data_files :
242240 ssc .add_file (
243241 data_file = data_file ,
244- partition_spec = default_spec ,
245- schema = schema ,
242+ partition_spec = table_metadata . spec () ,
243+ schema = table_metadata . schema () ,
246244 )
247245
248246 if len (self ._deleted_data_files ) > 0 :
@@ -251,7 +249,7 @@ def _summary(self, snapshot_properties: dict[str, str] = EMPTY_DICT) -> Summary:
251249 ssc .remove_file (
252250 data_file = data_file ,
253251 partition_spec = specs [data_file .spec_id ],
254- schema = schema ,
252+ schema = table_metadata . schema () ,
255253 )
256254
257255 previous_snapshot = (
@@ -426,14 +424,12 @@ def _copy_with_new_status(entry: ManifestEntry, status: ManifestEntryStatus) ->
426424 data_file = entry .data_file ,
427425 )
428426
429- # avoid copying metadata for each evaluator
430- table_metadata = self ._transaction .table_metadata
431- schema = table_metadata .schema ()
432-
433427 manifest_evaluators : dict [int , Callable [[ManifestFile ], bool ]] = KeyDefaultDict (self ._build_manifest_evaluator )
434- strict_metrics_evaluator = _StrictMetricsEvaluator (schema , self ._predicate , case_sensitive = self ._case_sensitive ).eval
428+ strict_metrics_evaluator = _StrictMetricsEvaluator (
429+ self .schema (), self ._predicate , case_sensitive = self ._case_sensitive
430+ ).eval
435431 inclusive_metrics_evaluator = _InclusiveMetricsEvaluator (
436- schema , self ._predicate , case_sensitive = self ._case_sensitive
432+ self . schema () , self ._predicate , case_sensitive = self ._case_sensitive
437433 ).eval
438434
439435 existing_manifests = []
@@ -445,7 +441,7 @@ def _copy_with_new_status(entry: ManifestEntry, status: ManifestEntryStatus) ->
445441 # Should be the current tip of the _target_branch
446442 parent_snapshot_id_for_delete_source = self ._parent_snapshot_id
447443 if parent_snapshot_id_for_delete_source is not None :
448- snapshot = table_metadata .snapshot_by_id (parent_snapshot_id_for_delete_source )
444+ snapshot = self . _transaction . table_metadata .snapshot_by_id (parent_snapshot_id_for_delete_source )
449445 if snapshot : # Ensure snapshot is found
450446 for manifest_file in snapshot .manifests (io = self ._io ):
451447 if manifest_file .content == ManifestContent .DATA :
@@ -546,19 +542,18 @@ def __init__(
546542 from pyiceberg .table import TableProperties
547543
548544 super ().__init__ (operation , transaction , io , commit_uuid , snapshot_properties , branch )
549- table_properties = self ._transaction .table_metadata .properties
550545 self ._target_size_bytes = property_as_int (
551- table_properties ,
546+ self . _transaction . table_metadata . properties ,
552547 TableProperties .MANIFEST_TARGET_SIZE_BYTES ,
553548 TableProperties .MANIFEST_TARGET_SIZE_BYTES_DEFAULT ,
554549 ) # type: ignore
555550 self ._min_count_to_merge = property_as_int (
556- table_properties ,
551+ self . _transaction . table_metadata . properties ,
557552 TableProperties .MANIFEST_MIN_MERGE_COUNT ,
558553 TableProperties .MANIFEST_MIN_MERGE_COUNT_DEFAULT ,
559554 ) # type: ignore
560555 self ._merge_enabled = property_as_bool (
561- table_properties ,
556+ self . _transaction . table_metadata . properties ,
562557 TableProperties .MANIFEST_MERGE_ENABLED ,
563558 TableProperties .MANIFEST_MERGE_ENABLED_DEFAULT ,
564559 )
0 commit comments