File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 19
19
20
20
from pandas .core import nanops
21
21
from pandas .core .arrays import ExtensionArray , ExtensionOpsMixin
22
- from pandas .core .ops import CompWrapper
23
22
from pandas .core .tools .numeric import to_numeric
24
23
25
24
@@ -530,17 +529,22 @@ def _values_for_argsort(self):
530
529
531
530
@classmethod
532
531
def _create_comparison_method (cls , op ):
533
- @CompWrapper (validate_len = True , inst_from_senior_cls = True )
534
532
def cmp_method (self , other ):
535
533
536
534
op_name = op .__name__
537
535
mask = None
538
536
537
+ if isinstance (other , (ABCSeries , ABCIndexClass )):
538
+ # Rely on pandas to unbox and dispatch to us.
539
+ return NotImplemented
540
+
539
541
if isinstance (other , IntegerArray ):
540
542
other , mask = other ._data , other ._mask
541
543
542
544
elif is_list_like (other ):
543
545
other = np .asarray (other )
546
+ if other .ndim > 0 and len (self ) != len (other ):
547
+ raise ValueError ('Lengths must match to compare' )
544
548
545
549
other = lib .item_from_zerodim (other )
546
550
You can’t perform that action at this time.
0 commit comments