@@ -474,19 +474,11 @@ def _deleted_entries(self) -> List[ManifestEntry]:
474474 return []
475475
476476
477- @dataclass (init = False )
477+ @dataclass (frozen = True )
478478class RewriteManifestsResult :
479479 rewritten_manifests : List [ManifestFile ] = field (default_factory = list )
480480 added_manifests : List [ManifestFile ] = field (default_factory = list )
481481
482- def __init__ (
483- self ,
484- rewritten_manifests : Optional [List [ManifestFile ]],
485- added_manifests : Optional [List [ManifestFile ]],
486- ) -> None :
487- self .rewritten_manifests = rewritten_manifests or []
488- self .added_manifests = added_manifests or []
489-
490482
491483class _MergeAppendFiles (_FastAppendFiles ):
492484 _target_size_bytes : int
@@ -653,14 +645,15 @@ def _find_matching_manifests(self, snapshot: Snapshot, content: ManifestContent)
653645 return RewriteManifestsResult (rewritten_manifests = manifests , added_manifests = new_manifests )
654646
655647 def _copy_manifest_file (self , manifest_file : ManifestFile , snapshot_id : int ) -> ManifestFile :
656- return ManifestFile (
648+ return ManifestFile .from_args (
649+ _table_format_version = self ._transaction .table_metadata .format_version ,
657650 manifest_path = manifest_file .manifest_path ,
658651 manifest_length = manifest_file .manifest_length ,
659652 partition_spec_id = manifest_file .partition_spec_id ,
660653 content = manifest_file .content ,
661654 sequence_number = manifest_file .sequence_number ,
662655 min_sequence_number = manifest_file .min_sequence_number ,
663- added_snapshot_id = snapshot_id ,
656+ added_snapshot_id = snapshot_id , # Using the new snapshot ID here
664657 added_files_count = manifest_file .added_files_count ,
665658 existing_files_count = manifest_file .existing_files_count ,
666659 deleted_files_count = manifest_file .deleted_files_count ,
0 commit comments