-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Move groupby tests out of test_function #55967
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
|
||
|
||
@pytest.mark.parametrize("f", [max, min, sum]) | ||
@pytest.mark.parametrize("keys", ["jim", ["jim", "joe"]]) # Single key # Multi-key |
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.
the comment might be clearer if instead of being a comment it was encoded in ids=["single_key", "multi_key"]
result = df.groupby("A", as_index=False).cumsum() | ||
tm.assert_frame_equal(result, expected) | ||
|
||
# GH 13994 |
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.
NBD (in part bc it will be removed in a few months) but probably should be split out into a separate test
df_out.set_index("a", inplace=True) | ||
|
||
grpd = df.groupby("a") | ||
t = getattr(grpd, method)(*data["args"]) |
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.
nitpick can we avoid 1-letter variable names while we're here
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.
(i like "result" and "expected" to make clear which one is which, particularly in places where neither is constructed explicitly)
tests arent changed, just cut/paste? |
Yea - that's right. Just a move here. Once |
@@ -219,3 +219,73 @@ def test_describe_duplicate_columns(): | |||
) | |||
expected.index.names = [1] | |||
tm.assert_frame_equal(result, expected) | |||
|
|||
|
|||
class TestGroupByNonCythonPaths: |
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.
Note for a follow up, would be good to collapse this class into just the testing function and fixtures
Thanks @rhshadrach |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.The tests that remain are tests that go across reductions, transformations, and filters. The bulk of these are tests for
numeric_only