File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 114
114
is_object_dtype ,
115
115
is_scalar ,
116
116
is_sequence ,
117
+ needs_i8_conversion ,
117
118
pandas_dtype ,
118
119
)
119
120
from pandas .core .dtypes .missing import isna , notna
@@ -6368,11 +6369,23 @@ def combine_first(self, other: DataFrame) -> DataFrame:
6368
6369
"""
6369
6370
import pandas .core .computation .expressions as expressions
6370
6371
6372
+ def extract_values (arr ):
6373
+ # get values if arr is Series or Index
6374
+ arr = extract_array (arr , extract_numpy = True )
6375
+
6376
+ # convert datelike to i8
6377
+ if needs_i8_conversion (arr .dtype ):
6378
+ if is_extension_array_dtype (arr .dtype ):
6379
+ arr = arr .asi8
6380
+ else :
6381
+ arr = arr .view ("i8" )
6382
+ return arr
6383
+
6371
6384
def combiner (x , y ):
6372
6385
mask = extract_array (isna (x ))
6373
6386
6374
- x_values = extract_array ( x , to_numpy = True )
6375
- y_values = extract_array ( y , to_numpy = True )
6387
+ x_values = extract_values ( x )
6388
+ y_values = extract_values ( y )
6376
6389
6377
6390
# If the column y in other DataFrame is not in first DataFrame,
6378
6391
# just return y_values.
You can’t perform that action at this time.
0 commit comments