File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -917,6 +917,10 @@ def _add_comparison_ops(cls):
917
917
cls .__le__ = cls ._create_comparison_method (operator .le )
918
918
cls .__ge__ = cls ._create_comparison_method (operator .ge )
919
919
920
+ def _validate_shape (self , other ):
921
+ if len (self ) != len (other ):
922
+ raise ValueError ('Lengths must match to compare' )
923
+
920
924
921
925
class ExtensionScalarOpsMixin (ExtensionOpsMixin ):
922
926
"""
Original file line number Diff line number Diff line change @@ -67,8 +67,7 @@ def wrapper(self, other):
67
67
elif isinstance (other , cls ):
68
68
self ._check_compatible_with (other )
69
69
70
- if other .ndim > 0 and len (self ) != len (other ):
71
- raise ValueError ('Lengths must match to compare' )
70
+ self ._validate_shape (other )
72
71
73
72
if not_implemented :
74
73
return NotImplemented
You can’t perform that action at this time.
0 commit comments