Skip to content

Commit ecaeb64

Browse files
committed
Use the public .codes property for internal comparison of CategoricalIndex
1 parent 459298d commit ecaeb64

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
@@ -329,9 +329,7 @@ def _check_types(left, right, obj: str = "Index") -> None:
329329
if isinstance(left, CategoricalIndex) and isinstance(
330330
right, CategoricalIndex
331331
):
332-
mismatch = (
333-
left._internal_get_values() != right._internal_get_values()
334-
)
332+
mismatch = left.codes != right.codes
335333
else:
336334
mismatch = left.values != right.values
337335

0 commit comments

Comments
 (0)