@@ -118,11 +118,10 @@ def merge(
118
118
right_index = right_index ,
119
119
sort = sort ,
120
120
suffixes = suffixes ,
121
- copy = copy ,
122
121
indicator = indicator ,
123
122
validate = validate ,
124
123
)
125
- return op .get_result ()
124
+ return op .get_result (copy = copy )
126
125
127
126
128
127
if __debug__ :
@@ -624,7 +623,6 @@ def __init__(
624
623
right_index : bool = False ,
625
624
sort : bool = True ,
626
625
suffixes : Suffixes = ("_x" , "_y" ),
627
- copy : bool = True ,
628
626
indicator : bool = False ,
629
627
validate : str | None = None ,
630
628
) -> None :
@@ -641,7 +639,6 @@ def __init__(
641
639
642
640
self .on = com .maybe_make_list (on )
643
641
644
- self .copy = copy
645
642
self .suffixes = suffixes
646
643
self .sort = sort
647
644
@@ -702,7 +699,7 @@ def __init__(
702
699
if validate is not None :
703
700
self ._validate (validate )
704
701
705
- def get_result (self ) -> DataFrame :
702
+ def get_result (self , copy : bool = True ) -> DataFrame :
706
703
if self .indicator :
707
704
self .left , self .right = self ._indicator_pre_merge (self .left , self .right )
708
705
@@ -719,7 +716,7 @@ def get_result(self) -> DataFrame:
719
716
[(self .left ._mgr , lindexers ), (self .right ._mgr , rindexers )],
720
717
axes = [llabels .append (rlabels ), join_index ],
721
718
concat_axis = 0 ,
722
- copy = self . copy ,
719
+ copy = copy ,
723
720
)
724
721
725
722
typ = self .left ._constructor
@@ -1100,7 +1097,7 @@ def _get_merge_keys(self):
1100
1097
else :
1101
1098
# work-around for merge_asof(right_index=True)
1102
1099
right_keys .append (right .index )
1103
- if lk is not None and lk == rk :
1100
+ if lk is not None and lk == rk : # FIXME: what about other NAs?
1104
1101
# avoid key upcast in corner case (length-0)
1105
1102
if len (left ) > 0 :
1106
1103
right_drop .append (rk )
@@ -1641,7 +1638,6 @@ def __init__(
1641
1638
right_index : bool = False ,
1642
1639
axis : int = 1 ,
1643
1640
suffixes : Suffixes = ("_x" , "_y" ),
1644
- copy : bool = True ,
1645
1641
fill_method : str | None = None ,
1646
1642
how : str = "outer" ,
1647
1643
) -> None :
@@ -1662,7 +1658,7 @@ def __init__(
1662
1658
sort = True , # factorize sorts
1663
1659
)
1664
1660
1665
- def get_result (self ) -> DataFrame :
1661
+ def get_result (self , copy : bool = True ) -> DataFrame :
1666
1662
join_index , left_indexer , right_indexer = self ._get_join_info ()
1667
1663
1668
1664
llabels , rlabels = _items_overlap_with_suffix (
@@ -1691,7 +1687,7 @@ def get_result(self) -> DataFrame:
1691
1687
[(self .left ._mgr , lindexers ), (self .right ._mgr , rindexers )],
1692
1688
axes = [llabels .append (rlabels ), join_index ],
1693
1689
concat_axis = 0 ,
1694
- copy = self . copy ,
1690
+ copy = copy ,
1695
1691
)
1696
1692
1697
1693
typ = self .left ._constructor
0 commit comments