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: dropping of nuisance columns for groupby ops #38815 #43674

Merged
merged 7 commits into from Oct 5, 2021

Conversation

horaceklai
Copy link
Contributor

@horaceklai horaceklai commented Sep 20, 2021

Add more aggregation functions for nuisance tests

Add more aggregation functions for nuisance tests
@jreback jreback changed the title GH 38815 TST: dropping of nuisance columns for groupby ops #38815 Sep 21, 2021
@jreback jreback added Groupby Testing pandas testing functions or related to the test suite labels Sep 21, 2021
@jreback jreback added this to the 1.4 milestone Sep 21, 2021
@jreback
Copy link
Contributor

jreback commented Sep 29, 2021

also pls merge master

@jreback
Copy link
Contributor

jreback commented Oct 2, 2021

https://github.com/pandas-dev/pandas/pull/43674/checks?check_run_id=3771738681
need sto assert this warning happens (this is pretty new btw)

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)
Copy link
Contributor

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

Copy link
Member

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

Copy link
Contributor

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(
Copy link
Contributor

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?

Copy link
Contributor Author

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)

@jreback jreback merged commit 3494078 into pandas-dev:master Oct 5, 2021
@jreback
Copy link
Contributor

jreback commented Oct 5, 2021

thanks @horaceklai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: dropping of nuisance columns for groupby ops
3 participants