Skip to content
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

TST: Don't ignore tolerance for integer series #56724

Merged
merged 7 commits into from
Jan 8, 2024

Conversation

phofl
Copy link
Member

@phofl phofl commented Jan 3, 2024

cc @lithomas1

@phofl phofl added the Testing pandas testing functions or related to the test suite label Jan 3, 2024
@phofl phofl added this to the 2.2 milestone Jan 3, 2024
@lithomas1
Copy link
Member

@phofl
Copy link
Member Author

phofl commented Jan 4, 2024

done

@lithomas1
Copy link
Member

Looks like 2 more places need to be updated.

check_exact : bool, default False
Whether to compare number exactly. Only takes effect for float dtypes.

check_exact : bool, default False
Whether to compare number exactly. Only takes effect for float dtypes.

@phofl
Copy link
Member Author

phofl commented Jan 6, 2024

Oh sorry, I think I got everything now

Copy link
Member

@lithomas1 lithomas1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thx for the quick fix!

cc @MarcoGorelli if you have any comments as well

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

little nitpick but looks good to me!

Comment on lines +753 to +758
check_exact = (
is_numeric_dtype(left.dtype)
and not is_float_dtype(left.dtype)
or is_numeric_dtype(right.dtype)
and not is_float_dtype(right.dtype)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick - I can never remember how a logic statement like this will be parsed, fancy making it move explicit with

        check_exact = (
            (is_numeric_dtype(left.dtype)
            and not is_float_dtype(left.dtype))
            or (is_numeric_dtype(right.dtype)
            and not is_float_dtype(right.dtype))
        )

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make the intendation worse? Not sure how black treats those

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to you, but it's very easy to get these wrong, e.g. https://github.com/pandas-dev/pandas/pull/34334/files

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intents look really off with parenthesis, will merge for now

@phofl phofl merged commit 3df5771 into pandas-dev:main Jan 8, 2024
50 checks passed
@phofl phofl deleted the assert_series_equal branch January 8, 2024 21:40
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Jan 8, 2024
mroeschke pushed a commit that referenced this pull request Jan 8, 2024
…nteger series) (#56786)

Backport PR #56724: TST: Don't ignore tolerance for integer series

Co-authored-by: Patrick Hoefler <[email protected]>
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pd.testing.assert_series_equal break in version 2.2.0rc0
3 participants