File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1010,11 +1010,7 @@ def coerce_to_target_dtype(self, other):
1010
1010
if is_dtype_equal (self .dtype , dtype ):
1011
1011
return self
1012
1012
1013
- if (
1014
- is_extension_array_dtype (self .dtype )
1015
- and not is_categorical_dtype (self .dtype )
1016
- and not self .is_datetime
1017
- ):
1013
+ if is_extension_array_dtype (self .dtype ) and not is_categorical_dtype (self .dtype ):
1018
1014
dtype = self .dtype
1019
1015
1020
1016
elif self .is_bool or is_object_dtype (dtype ) or is_bool_dtype (dtype ):
@@ -1060,6 +1056,8 @@ def coerce_to_target_dtype(self, other):
1060
1056
raise AssertionError (
1061
1057
f"possible recursion in coerce_to_target_dtype: { self } { other } "
1062
1058
)
1059
+ if is_categorical_dtype (dtype ) or self .is_datetime :
1060
+ return self .astype (object )
1063
1061
1064
1062
try :
1065
1063
return self .astype (dtype )
You can’t perform that action at this time.
0 commit comments