@@ -42,9 +42,9 @@ from pandas._libs.tslibs.util cimport (
42
42
is_timedelta64_object,
43
43
)
44
44
45
- from pandas._libs.tslibs.base cimport ABCTimestamp, ABCTimedelta
45
+ from pandas._libs.tslibs.base cimport ABCTimedelta
46
46
from pandas._libs.tslibs.timezones cimport tz_compare
47
-
47
+ from pandas._libs.tslibs.timestamps cimport _Timestamp
48
48
49
49
_VALID_CLOSED = frozenset ([' left' , ' right' , ' both' , ' neither' ])
50
50
@@ -328,7 +328,7 @@ cdef class Interval(IntervalMixin):
328
328
raise ValueError (f" invalid option for 'closed': {closed}" )
329
329
if not left <= right:
330
330
raise ValueError (" left side of interval must be <= right side" )
331
- if (isinstance (left, ABCTimestamp ) and
331
+ if (isinstance (left, _Timestamp ) and
332
332
not tz_compare(left.tzinfo, right.tzinfo)):
333
333
# GH 18538
334
334
raise ValueError (" left and right must have the same time zone, got "
@@ -340,7 +340,7 @@ cdef class Interval(IntervalMixin):
340
340
def _validate_endpoint (self , endpoint ):
341
341
# GH 23013
342
342
if not (is_integer_object(endpoint) or is_float_object(endpoint) or
343
- isinstance (endpoint, (ABCTimestamp , ABCTimedelta))):
343
+ isinstance (endpoint, (_Timestamp , ABCTimedelta))):
344
344
raise ValueError (" Only numeric, Timestamp and Timedelta endpoints "
345
345
" are allowed when constructing an Interval." )
346
346
@@ -370,7 +370,7 @@ cdef class Interval(IntervalMixin):
370
370
right = self .right
371
371
372
372
# TODO: need more general formatting methodology here
373
- if isinstance (left, ABCTimestamp ) and isinstance (right, ABCTimestamp ):
373
+ if isinstance (left, _Timestamp ) and isinstance (right, _Timestamp ):
374
374
left = left._short_repr
375
375
right = right._short_repr
376
376
0 commit comments