32
32
from pandas .api .types import is_bool_dtype
33
33
from pandas .core .dtypes .generic import ABCDataFrame , ABCSeries
34
34
try :
35
- from pandas .core .dtypes .generic import ABCIndexClass
35
+ from pandas .core .dtypes .generic import ABCIndex
36
36
except ImportError :
37
37
# ABCIndexClass changed to ABCIndex in Pandas 1.3
38
38
# noinspection PyUnresolvedReferences
39
- from pandas .core .dtypes .generic import ABCIndex
40
- ABCIndexClass = ABCIndex
39
+ from pandas .core .dtypes .generic import ABCIndexClass as ABCIndex
41
40
from pandas .core .indexers import check_array_indexer
42
41
43
42
# Internal imports
@@ -82,7 +81,7 @@ def __add__(self, other) -> Union["Span", "SpanArray"]:
82
81
:param other: Span or SpanArray
83
82
:return: minimal span (or array of spans) that covers both inputs.
84
83
"""
85
- if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndexClass )):
84
+ if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndex )):
86
85
# Rely on pandas to unbox and dispatch to us.
87
86
return NotImplemented
88
87
@@ -523,7 +522,7 @@ def __eq__(self, other):
523
522
524
523
:return: Returns a boolean mask indicating which rows match `other`.
525
524
"""
526
- if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndexClass )):
525
+ if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndex )):
527
526
# Rely on pandas to unbox and dispatch to us.
528
527
return NotImplemented
529
528
if isinstance (other , Span ):
@@ -550,7 +549,7 @@ def __eq__(self, other):
550
549
"'{}' and '{}'" .format (type (self ), type (other )))
551
550
552
551
def __ne__ (self , other ):
553
- if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndexClass )):
552
+ if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndex )):
554
553
# Rely on pandas to unbox and dispatch to us.
555
554
return NotImplemented
556
555
return ~ (self == other )
@@ -760,7 +759,7 @@ def __lt__(self, other):
760
759
`other`. span1 < span2 if span1.end <= span2.begin and both spans are over
761
760
the same target text.
762
761
"""
763
- if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndexClass )):
762
+ if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndex )):
764
763
# Rely on pandas to unbox and dispatch to us.
765
764
return NotImplemented
766
765
elif not isinstance (other , (Span , SpanArray )):
@@ -772,7 +771,7 @@ def __lt__(self, other):
772
771
return np .logical_and (offsets_mask , text_mask )
773
772
774
773
def __gt__ (self , other ):
775
- if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndexClass )):
774
+ if isinstance (other , (ABCDataFrame , ABCSeries , ABCIndex )):
776
775
# Rely on pandas to unbox and dispatch to us.
777
776
return NotImplemented
778
777
if isinstance (other , (SpanArray , Span )):
0 commit comments