@@ -859,7 +859,11 @@ def upsert(
859859 return UpsertResult (rows_updated = update_row_cnt , rows_inserted = insert_row_cnt )
860860
861861 def add_files (
862- self , file_paths : List [str ], snapshot_properties : Dict [str , str ] = EMPTY_DICT , check_duplicate_files : bool = True
862+ self ,
863+ file_paths : List [str ],
864+ snapshot_properties : Dict [str , str ] = EMPTY_DICT ,
865+ check_duplicate_files : bool = True ,
866+ branch : Optional [str ] = MAIN_BRANCH ,
863867 ) -> None :
864868 """
865869 Shorthand API for adding files as data files to the table transaction.
@@ -888,12 +892,12 @@ def add_files(
888892 self .set_properties (
889893 ** {TableProperties .DEFAULT_NAME_MAPPING : self .table_metadata .schema ().name_mapping .model_dump_json ()}
890894 )
891- with self .update_snapshot (snapshot_properties = snapshot_properties ). fast_append () as update_snapshot :
895+ with self ._append_snapshot_producer (snapshot_properties , branch = branch ) as append_files :
892896 data_files = _parquet_files_to_data_files (
893897 table_metadata = self .table_metadata , file_paths = file_paths , io = self ._table .io
894898 )
895899 for data_file in data_files :
896- update_snapshot .append_data_file (data_file )
900+ append_files .append_data_file (data_file )
897901
898902 def update_spec (self ) -> UpdateSpec :
899903 """Create a new UpdateSpec to update the partitioning of the table.
@@ -1431,7 +1435,11 @@ def delete(
14311435 )
14321436
14331437 def add_files (
1434- self , file_paths : List [str ], snapshot_properties : Dict [str , str ] = EMPTY_DICT , check_duplicate_files : bool = True
1438+ self ,
1439+ file_paths : List [str ],
1440+ snapshot_properties : Dict [str , str ] = EMPTY_DICT ,
1441+ check_duplicate_files : bool = True ,
1442+ branch : Optional [str ] = MAIN_BRANCH ,
14351443 ) -> None :
14361444 """
14371445 Shorthand API for adding files as data files to the table.
@@ -1444,7 +1452,10 @@ def add_files(
14441452 """
14451453 with self .transaction () as tx :
14461454 tx .add_files (
1447- file_paths = file_paths , snapshot_properties = snapshot_properties , check_duplicate_files = check_duplicate_files
1455+ file_paths = file_paths ,
1456+ snapshot_properties = snapshot_properties ,
1457+ check_duplicate_files = check_duplicate_files ,
1458+ branch = branch ,
14481459 )
14491460
14501461 def update_spec (self , case_sensitive : bool = True ) -> UpdateSpec :
0 commit comments