Skip to content

Commit 7eb28d4

Browse files
committed
Remove CompWrapper
1 parent 587008d commit 7eb28d4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/core/arrays/integer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
from pandas.core import nanops
2121
from pandas.core.arrays import ExtensionArray, ExtensionOpsMixin
22-
from pandas.core.ops import CompWrapper
2322
from pandas.core.tools.numeric import to_numeric
2423

2524

@@ -530,17 +529,22 @@ def _values_for_argsort(self):
530529

531530
@classmethod
532531
def _create_comparison_method(cls, op):
533-
@CompWrapper(validate_len=True, inst_from_senior_cls=True)
534532
def cmp_method(self, other):
535533

536534
op_name = op.__name__
537535
mask = None
538536

537+
if isinstance(other, (ABCSeries, ABCIndexClass)):
538+
# Rely on pandas to unbox and dispatch to us.
539+
return NotImplemented
540+
539541
if isinstance(other, IntegerArray):
540542
other, mask = other._data, other._mask
541543

542544
elif is_list_like(other):
543545
other = np.asarray(other)
546+
if other.ndim > 0 and len(self) != len(other):
547+
raise ValueError('Lengths must match to compare')
544548

545549
other = lib.item_from_zerodim(other)
546550

0 commit comments

Comments
 (0)