Skip to content

Commit 7523bab

Browse files
String dtype: fix alignment sorting in case of python storage
1 parent 7147203 commit 7523bab

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pandas/core/generic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9542,7 +9542,6 @@ def _align_series(
95429542
join_index, lidx, ridx = self.index.join(
95439543
other.index, how=join, level=level, return_indexers=True
95449544
)
9545-
95469545
if is_series:
95479546
left = self._reindex_indexer(join_index, lidx)
95489547
elif lidx is None or join_index is None:

pandas/core/indexes/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4884,7 +4884,10 @@ def _can_use_libjoin(self) -> bool:
48844884
return (
48854885
isinstance(self.dtype, np.dtype)
48864886
or isinstance(self._values, (ArrowExtensionArray, BaseMaskedArray))
4887-
or self.dtype == "string[python]"
4887+
or (
4888+
isinstance(self.dtype, StringDtype)
4889+
and self.dtype.storage == "python"
4890+
)
48884891
)
48894892
# Exclude index types where the conversion to numpy converts to object dtype,
48904893
# which negates the performance benefit of libjoin

0 commit comments

Comments
 (0)