Skip to content

BUG: Let check_exact_index default to True for integers #58189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 24, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pandas/_testing/asserters.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,6 @@ def assert_series_equal(
>>> tm.assert_series_equal(a, b)
"""
__tracebackhide__ = True
check_exact_index = False if check_exact is lib.no_default else check_exact
if (
check_exact is lib.no_default
and rtol is lib.no_default
Expand All @@ -914,8 +913,17 @@ def assert_series_equal(
or is_numeric_dtype(right.dtype)
and not is_float_dtype(right.dtype)
)
check_exact_index = (
is_numeric_dtype(left.index.dtype)
and not is_float_dtype(left.index.dtype)
or is_numeric_dtype(right.index.dtype)
and not is_float_dtype(right.index.dtype)
)
elif check_exact is lib.no_default:
check_exact = False
check_exact_index = False
else:
check_exact_index = check_exact

rtol = rtol if rtol is not lib.no_default else 1.0e-5
atol = atol if atol is not lib.no_default else 1.0e-8
Expand Down