Skip to content

Commit 3e9cac3

Browse files
fix combiner
1 parent a609b57 commit 3e9cac3

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

pandas/core/frame.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9141,20 +9141,10 @@ def combine_first(self, other: DataFrame) -> DataFrame:
91419141
1 0.0 3.0 1.0
91429142
2 NaN 3.0 1.0
91439143
"""
9144-
from pandas.core.computation import expressions
91459144

91469145
def combiner(x: Series, y: Series):
9147-
mask = x.isna()._values
9148-
9149-
x_values = x._values
9150-
y_values = y._values
9151-
9152-
# If the column y in other DataFrame is not in first DataFrame,
9153-
# just return y_values.
9154-
if y.name not in self.columns:
9155-
return y_values
9156-
9157-
return expressions.where(mask, y_values, x_values)
9146+
# GH#60128 The combiner is supposed to preserve EA Dtypes.
9147+
return y if y.name not in self.columns else y.where(x.isna(), x)
91589148

91599149
if len(other) == 0:
91609150
combined = self.reindex(

0 commit comments

Comments
 (0)