53
53
from pandas .core .arrays import datetimelike as dtl
54
54
from pandas .core .arrays ._ranges import generate_regular_range
55
55
import pandas .core .common as com
56
+ from pandas .core .ops .invalid import invalid_comparison
56
57
57
58
from pandas .tseries .frequencies import get_period_alias , to_offset
58
59
from pandas .tseries .offsets import Day , Tick
@@ -171,13 +172,13 @@ def wrapper(self, other):
171
172
other = _to_M8 (other , tz = self .tz )
172
173
except ValueError :
173
174
# string that cannot be parsed to Timestamp
174
- return ops . invalid_comparison (self , other , op )
175
+ return invalid_comparison (self , other , op )
175
176
176
177
result = op (self .asi8 , other .view ("i8" ))
177
178
if isna (other ):
178
179
result .fill (nat_result )
179
180
elif lib .is_scalar (other ) or np .ndim (other ) == 0 :
180
- return ops . invalid_comparison (self , other , op )
181
+ return invalid_comparison (self , other , op )
181
182
elif len (other ) != len (self ):
182
183
raise ValueError ("Lengths must match" )
183
184
else :
@@ -191,7 +192,7 @@ def wrapper(self, other):
191
192
):
192
193
# Following Timestamp convention, __eq__ is all-False
193
194
# and __ne__ is all True, others raise TypeError.
194
- return ops . invalid_comparison (self , other , op )
195
+ return invalid_comparison (self , other , op )
195
196
196
197
if is_object_dtype (other ):
197
198
# We have to use _comp_method_OBJECT_ARRAY instead of numpy
@@ -204,7 +205,7 @@ def wrapper(self, other):
204
205
o_mask = isna (other )
205
206
elif not (is_datetime64_dtype (other ) or is_datetime64tz_dtype (other )):
206
207
# e.g. is_timedelta64_dtype(other)
207
- return ops . invalid_comparison (self , other , op )
208
+ return invalid_comparison (self , other , op )
208
209
else :
209
210
self ._assert_tzawareness_compat (other )
210
211
if isinstance (other , (ABCIndexClass , ABCSeries )):
0 commit comments