@@ -3732,10 +3732,11 @@ def get_indexer(
3732
3732
# Only call equals if we have same dtype to avoid inference/casting
3733
3733
return np .arange (len (target ), dtype = np .intp )
3734
3734
3735
- if not is_dtype_equal (self .dtype , target .dtype ) and not is_interval_dtype (
3736
- self .dtype
3737
- ):
3738
- # IntervalIndex gets special treatment for partial-indexing
3735
+ if not is_dtype_equal (
3736
+ self .dtype , target .dtype
3737
+ ) and not self ._should_partial_index (target ):
3738
+ # _should_partial_index e.g. IntervalIndex with numeric scalars
3739
+ # that can be matched to Interval scalars.
3739
3740
dtype = self ._find_common_type_compat (target )
3740
3741
3741
3742
this = self .astype (dtype , copy = False )
@@ -5739,9 +5740,9 @@ def get_indexer_non_unique(
5739
5740
target = ensure_index (target )
5740
5741
target = self ._maybe_cast_listlike_indexer (target )
5741
5742
5742
- if not self ._should_compare (target ) and not is_interval_dtype ( self .dtype ):
5743
- # IntervalIndex get special treatment bc numeric scalars can be
5744
- # matched to Interval scalars
5743
+ if not self ._should_compare (target ) and not self ._should_partial_index ( target ):
5744
+ # _should_partial_index e.g. IntervalIndex with numeric scalars
5745
+ # that can be matched to Interval scalars.
5745
5746
return self ._get_indexer_non_comparable (target , method = None , unique = False )
5746
5747
5747
5748
pself , ptarget = self ._maybe_promote (target )
0 commit comments