-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: dropping of nuisance columns for groupby ops #38815 #43674
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
Conversation
also pls merge master |
https://github.com/pandas-dev/pandas/pull/43674/checks?check_run_id=3771738681 |
pandas/tests/groupby/test_groupby.py
Outdated
expected = df.loc[:, ["A", "C", "D"]].groupby("A").sem() | ||
result = getattr(grouped, agg_function)().columns | ||
expected = df.loc[:, ["B", "C", "D"]].columns | ||
np.testing.assert_array_equal(result, expected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never use np.testing
, in this case use tm.assert_frame_equal
(don'tjust compare the columns)
I think we have a rule which should fail tests about this cc @MarcoGorelli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I thought there was one - currently on holiday, will check next week when I'm back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@horaceklai if you can change this one as well
) | ||
def test_omit_nuisance_warnings(df, agg_function): | ||
# GH 38815 | ||
with tm.assert_produces_warning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this warning? why are you adding extra options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the warning that you wanted to be asserted. I took away the parameterization now
https://github.com/pandas-dev/pandas/pull/43674/checks?check_run_id=3771738681
need sto assert this warning happens (this is pretty new btw)
thanks @horaceklai |
Add more aggregation functions for nuisance tests