Skip to content

Commit

Permalink
Backport PR pandas-dev#48472: PERF: keep using ObjectEngine for Exten…
Browse files Browse the repository at this point in the history
…sionArrays for 1.5
  • Loading branch information
jorisvandenbossche authored and meeseeksmachine committed Sep 9, 2022
1 parent 54c1aa2 commit 716beae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5154,6 +5154,9 @@ def _get_engine_target(self) -> ArrayLike:
if isinstance(vals, StringArray):
# GH#45652 much more performant than ExtensionEngine
return vals._ndarray
if type(self) is Index and isinstance(self._values, ExtensionArray):
# TODO(ExtensionIndex): remove special-case, just use self._values
return self._values.astype(object)
return vals

def _from_join_target(self, result: np.ndarray) -> ArrayLike:
Expand Down

0 comments on commit 716beae

Please sign in to comment.