@@ -399,7 +399,9 @@ def _build_partition_predicate(self, partition_records: Set[Record]) -> BooleanE
399399 expr = Or (expr , match_partition_expression )
400400 return expr
401401
402- def _append_snapshot_producer (self , snapshot_properties : Dict [str , str ], branch : Optional [str ]) -> _FastAppendFiles :
402+ def _append_snapshot_producer (
403+ self , snapshot_properties : Dict [str , str ], branch : Optional [str ] = MAIN_BRANCH
404+ ) -> _FastAppendFiles :
403405 """Determine the append type based on table properties.
404406
405407 Args:
@@ -433,19 +435,14 @@ def update_schema(self, allow_incompatible_changes: bool = False, case_sensitive
433435 )
434436
435437 def update_snapshot (
436- self , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = None , stage_only : bool = False
438+ self , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = MAIN_BRANCH
437439 ) -> UpdateSnapshot :
438440 """Create a new UpdateSnapshot to produce a new snapshot for the table.
439441
440442 Returns:
441443 A new UpdateSnapshot
442444 """
443- if branch is None :
444- branch = MAIN_BRANCH
445-
446- return UpdateSnapshot (
447- self , io = self ._table .io , branch = branch , snapshot_properties = snapshot_properties , stage_only = stage_only
448- )
445+ return UpdateSnapshot (self , io = self ._table .io , branch = branch , snapshot_properties = snapshot_properties )
449446
450447 def update_statistics (self ) -> UpdateStatistics :
451448 """
@@ -456,7 +453,7 @@ def update_statistics(self) -> UpdateStatistics:
456453 """
457454 return UpdateStatistics (transaction = self )
458455
459- def append (self , df : pa .Table , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = None ) -> None :
456+ def append (self , df : pa .Table , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = MAIN_BRANCH ) -> None :
460457 """
461458 Shorthand API for appending a PyArrow table to a table transaction.
462459
@@ -498,7 +495,7 @@ def append(self, df: pa.Table, snapshot_properties: Dict[str, str] = EMPTY_DICT,
498495 append_files .append_data_file (data_file )
499496
500497 def dynamic_partition_overwrite (
501- self , df : pa .Table , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = None
498+ self , df : pa .Table , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = MAIN_BRANCH
502499 ) -> None :
503500 """
504501 Shorthand for overwriting existing partitions with a PyArrow table.
@@ -562,7 +559,7 @@ def overwrite(
562559 overwrite_filter : Union [BooleanExpression , str ] = ALWAYS_TRUE ,
563560 snapshot_properties : Dict [str , str ] = EMPTY_DICT ,
564561 case_sensitive : bool = True ,
565- branch : Optional [str ] = None ,
562+ branch : Optional [str ] = MAIN_BRANCH ,
566563 ) -> None :
567564 """
568565 Shorthand for adding a table overwrite with a PyArrow table to the transaction.
@@ -625,7 +622,7 @@ def delete(
625622 delete_filter : Union [str , BooleanExpression ],
626623 snapshot_properties : Dict [str , str ] = EMPTY_DICT ,
627624 case_sensitive : bool = True ,
628- branch : Optional [str ] = None ,
625+ branch : Optional [str ] = MAIN_BRANCH ,
629626 ) -> None :
630627 """
631628 Shorthand for deleting record from a table.
@@ -728,7 +725,7 @@ def upsert(
728725 when_matched_update_all : bool = True ,
729726 when_not_matched_insert_all : bool = True ,
730727 case_sensitive : bool = True ,
731- branch : Optional [str ] = None ,
728+ branch : Optional [str ] = MAIN_BRANCH ,
732729 ) -> UpsertResult :
733730 """Shorthand API for performing an upsert to an iceberg table.
734731
@@ -1295,7 +1292,7 @@ def upsert(
12951292 when_matched_update_all : bool = True ,
12961293 when_not_matched_insert_all : bool = True ,
12971294 case_sensitive : bool = True ,
1298- branch : Optional [str ] = None ,
1295+ branch : Optional [str ] = MAIN_BRANCH ,
12991296 ) -> UpsertResult :
13001297 """Shorthand API for performing an upsert to an iceberg table.
13011298
@@ -1342,7 +1339,7 @@ def upsert(
13421339 branch = branch ,
13431340 )
13441341
1345- def append (self , df : pa .Table , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = None ) -> None :
1342+ def append (self , df : pa .Table , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = MAIN_BRANCH ) -> None :
13461343 """
13471344 Shorthand API for appending a PyArrow table to the table.
13481345
@@ -1355,7 +1352,7 @@ def append(self, df: pa.Table, snapshot_properties: Dict[str, str] = EMPTY_DICT,
13551352 tx .append (df = df , snapshot_properties = snapshot_properties , branch = branch )
13561353
13571354 def dynamic_partition_overwrite (
1358- self , df : pa .Table , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = None
1355+ self , df : pa .Table , snapshot_properties : Dict [str , str ] = EMPTY_DICT , branch : Optional [str ] = MAIN_BRANCH
13591356 ) -> None :
13601357 """Shorthand for dynamic overwriting the table with a PyArrow table.
13611358
@@ -1374,7 +1371,7 @@ def overwrite(
13741371 overwrite_filter : Union [BooleanExpression , str ] = ALWAYS_TRUE ,
13751372 snapshot_properties : Dict [str , str ] = EMPTY_DICT ,
13761373 case_sensitive : bool = True ,
1377- branch : Optional [str ] = None ,
1374+ branch : Optional [str ] = MAIN_BRANCH ,
13781375 ) -> None :
13791376 """
13801377 Shorthand for overwriting the table with a PyArrow table.
@@ -1407,7 +1404,7 @@ def delete(
14071404 delete_filter : Union [BooleanExpression , str ] = ALWAYS_TRUE ,
14081405 snapshot_properties : Dict [str , str ] = EMPTY_DICT ,
14091406 case_sensitive : bool = True ,
1410- branch : Optional [str ] = None ,
1407+ branch : Optional [str ] = MAIN_BRANCH ,
14111408 ) -> None :
14121409 """
14131410 Shorthand for deleting rows from the table.
0 commit comments