Skip to content

Commit 73ee7e1

Browse files
committed
CLN: use invalid_comparison for broken case
1 parent 35821a5 commit 73ee7e1

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pandas/core/indexes/base.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,11 @@ def cmp_method(self, other):
112112
with np.errstate(all="ignore"):
113113
result = op(self.values, np.asarray(other))
114114

115-
# technically we could support bool dtyped Index
116-
# for now just return the indexing array directly
117115
if is_bool_dtype(result):
118116
return result
119-
try:
120-
return Index(result)
121-
except TypeError:
122-
return result
117+
return ops.invalid_comparison(self, other, op)
123118

124119
name = "__{name}__".format(name=op.__name__)
125-
# TODO: docstring?
126120
return set_function_name(cmp_method, name, cls)
127121

128122

0 commit comments

Comments
 (0)