@@ -5514,16 +5514,6 @@ def _get_indexer_non_comparable(
5514
5514
"""
5515
5515
if method is not None :
5516
5516
other = unpack_nested_dtype (target )
5517
- if self ._is_multi ^ other ._is_multi :
5518
- kind = other .dtype .type if self ._is_multi else self .dtype .type
5519
- raise TypeError (
5520
- f"'<' not supported between instances of { kind } and 'tuple'"
5521
- )
5522
- elif self ._is_multi and other ._is_multi :
5523
- assert self .nlevels != other .nlevels
5524
- # Python allows comparison between tuples of different lengths,
5525
- # but for our purposes such a comparison is not meaningful.
5526
- raise TypeError ("'<' not supported between tuples of different lengths" )
5527
5517
raise TypeError (f"Cannot compare dtypes { self .dtype } and { other .dtype } " )
5528
5518
5529
5519
no_matches = - 1 * np .ones (target .shape , dtype = np .intp )
@@ -5653,14 +5643,6 @@ def _should_compare(self, other: Index) -> bool:
5653
5643
5654
5644
other = unpack_nested_dtype (other )
5655
5645
dtype = other .dtype
5656
- if other ._is_multi :
5657
- if not self ._is_multi :
5658
- # other contains only tuples so unless we are object-dtype,
5659
- # there can never be any matches
5660
- return self ._is_comparable_dtype (dtype )
5661
- return self .nlevels == other .nlevels
5662
- # TODO: we can get more specific requiring levels are comparable?
5663
-
5664
5646
return self ._is_comparable_dtype (dtype ) or is_object_dtype (dtype )
5665
5647
5666
5648
def _is_comparable_dtype (self , dtype : DtypeObj ) -> bool :
0 commit comments