Skip to content

Commit abbaf48

Browse files
committed
FIX: Test need sort only work on lexsorted indexes
1 parent d8ec6c8 commit abbaf48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/indexes/multi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3084,7 +3084,8 @@ def _reorder_indexer(
30843084
# True if the given codes are not ordered
30853085
need_sort = (k_codes[:-1] > k_codes[1:]).any()
30863086
# Bail out if no need to sort
3087-
if not need_sort:
3087+
# This is only true for a lexsorted index
3088+
if not need_sort and self.is_lexsorted():
30883089
return indexer
30893090

30903091
n = len(self)

0 commit comments

Comments
 (0)