Skip to content

Commit b82f867

Browse files
committed
Use the public .codes property for internal comparison of CategoricalIndex
1 parent 2ba4cfb commit b82f867

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/_testing/asserters.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,7 @@ def _check_types(left, right, obj: str = "Index") -> None:
332332
if isinstance(left, CategoricalIndex) and isinstance(
333333
right, CategoricalIndex
334334
):
335-
mismatch = (
336-
left._internal_get_values() != right._internal_get_values()
337-
)
335+
mismatch = left.codes != right.codes
338336
else:
339337
mismatch = left.values != right.values
340338

0 commit comments

Comments
 (0)