Skip to content

Commit c34ae66

Browse files
committed
move inferred_type check
1 parent 74f50ed commit c34ae66

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pandas/_testing/asserters.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,15 @@ def _check_types(left, right, obj="Index") -> None:
314314
return
315315

316316
assert_class_equal(left, right, exact=exact, obj=obj)
317+
assert_attr_equal("inferred_type", left, right, obj=obj)
317318

318319
# Skip exact dtype checking when `check_categorical` is False
319320
if is_categorical_dtype(left.dtype) and is_categorical_dtype(right.dtype):
320321
if check_categorical:
321322
assert_attr_equal("dtype", left, right, obj=obj)
322323
assert_index_equal(left.categories, right.categories, exact=exact)
323-
assert_attr_equal("inferred_type", left, right, obj=obj)
324324
return
325325

326-
assert_attr_equal("inferred_type", left, right, obj=obj)
327326
assert_attr_equal("dtype", left, right, obj=obj)
328327

329328
def _get_ilevel_values(index, level):

0 commit comments

Comments
 (0)