1212from pandas .util ._decorators import Appender , cache_readonly , doc
1313
1414from pandas .core .dtypes .common import (
15- ensure_platform_int ,
1615 is_bool_dtype ,
1716 is_datetime64_any_dtype ,
1817 is_dtype_equal ,
@@ -473,12 +472,13 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None):
473472 target = ensure_index (target )
474473
475474 if isinstance (target , PeriodIndex ):
476- if target .freq != self .freq :
475+ if not self ._is_comparable_dtype (target .dtype ):
476+ # i.e. target.freq != self.freq
477477 # No matches
478478 no_matches = - 1 * np .ones (self .shape , dtype = np .intp )
479479 return no_matches
480480
481- target = target .asi8
481+ target = target ._get_engine_target () # i.e. target. asi8
482482 self_index = self ._int64index
483483 else :
484484 self_index = self
@@ -491,19 +491,6 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None):
491491
492492 return Index .get_indexer (self_index , target , method , limit , tolerance )
493493
494- @Appender (_index_shared_docs ["get_indexer_non_unique" ] % _index_doc_kwargs )
495- def get_indexer_non_unique (self , target ):
496- target = ensure_index (target )
497-
498- if not self ._is_comparable_dtype (target .dtype ):
499- no_matches = - 1 * np .ones (self .shape , dtype = np .intp )
500- return no_matches , no_matches
501-
502- target = target .asi8
503-
504- indexer , missing = self ._int64index .get_indexer_non_unique (target )
505- return ensure_platform_int (indexer ), missing
506-
507494 def get_loc (self , key , method = None , tolerance = None ):
508495 """
509496 Get integer location for requested label.
0 commit comments