@@ -935,13 +935,9 @@ def wrapper(left, right):
935
935
)
936
936
937
937
elif is_datetime64_dtype (left ) or is_datetime64tz_dtype (left ):
938
- # Give dispatch_to_index_op a chance for tests like
939
- # test_dt64_series_add_intlike, which the index dispatching handles
940
- # specifically.
941
- result = dispatch_to_index_op (op , left , right , pd .DatetimeIndex )
942
- return construct_result (
943
- left , result , index = left .index , name = res_name , dtype = result .dtype
944
- )
938
+ from pandas .core .arrays import DatetimeArray
939
+ result = dispatch_to_extension_op (op , DatetimeArray (left ), right )
940
+ return construct_result (left , result , index = left .index , name = res_name )
945
941
946
942
elif is_extension_array_dtype (left ) or (
947
943
is_extension_array_dtype (right ) and not is_scalar (right )
@@ -1094,7 +1090,7 @@ def wrapper(self, other, axis=None):
1094
1090
elif is_categorical_dtype (self ):
1095
1091
# Dispatch to Categorical implementation; CategoricalIndex
1096
1092
# behavior is non-canonical GH#19513
1097
- res_values = dispatch_to_index_op (op , self , other , pd . Categorical )
1093
+ res_values = dispatch_to_extension_op (op , self , other )
1098
1094
return self ._constructor (res_values , index = self .index , name = res_name )
1099
1095
1100
1096
elif is_datetime64_dtype (self ) or is_datetime64tz_dtype (self ):
0 commit comments