-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: Remove groupby/test_function.py #56338
Conversation
(24650000000000001, 24650000000000002), | ||
], | ||
) | ||
def test_groupby_nth_int_like_precision(data): |
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 tests has been cleaned up and not just moved.
], | ||
) | ||
@pytest.mark.parametrize("method", ["count", "min", "max", "first", "last"]) | ||
def test_groupby_non_arithmetic_agg_int_like_precision(method, data): |
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 tests has been cleaned up and not just moved.
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.
looks reasonable to me. nice work
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.
Breaking up a parameterized test and duplicating code across multiple files seems pretty bad. While I don't love having test_all_methods (it's sort of a catch-all), at first it seemed to me that it is less bad than breaking up the parameterized tests.
IMO I think in the future this could be rolled into a potential refactor of test_groupby.py
as a file testing "groupby scenarios that should work with all methods"
Thanks @rhshadrach |
Sounds good - |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This finishes up the removal of test_function.py from the groupby tests. With the exception of
test_groupby_non_arithmetic_agg_int_like_precision
(which is moved to other files here), the tests that remained fall into two (and partially overlapping) camps:numeric_only
groupby_func
, which goes over every groupby operationFor the first, the options I considered were creating
test_numeric_only.py
or split it up into various other files such astest_reductions.py
,test_cumlative.py
, and some others. Similarly, for tests that usegroupby_func
that don't fit in other files, I considered creatingtest_all_methods.py
(which can be renamed to something better) or split up the tests into several different files.I'm completely on the fence here. Breaking up a parameterized test and duplicating code across multiple files seems pretty bad. While I don't love having
test_all_methods
(it's sort of a catch-all), at first it seemed to me that it is less bad than breaking up the parameterized tests. But then grepping around, it appears that there are only three tests across all of groupby that would go intest_all_methods
. Perhaps this is something we can expand on later - but maybe since there are so few tests it's okay to break these up?Any ideas here are very much welcome.
cc @jbrockmendel @mroeschke