-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Add test for groupby aggregatation with nested dictionary #50079
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: Add test for groupby aggregatation with nested dictionary #50079
Conversation
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.
test looks fine, can you run the pre-commit checks please? check the contributing guide for how
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 good to me - @rhshadrach any comments?
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 good - just a request on the test name.
@@ -468,6 +468,16 @@ def test_groupby_agg_coercing_bools(): | |||
tm.assert_series_equal(result, expected) | |||
|
|||
|
|||
def test_groupby_agg_nested_dictionary(): |
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.
You're not testing nested dictionaries here, so I think this name is misleading. I think we test dictionary behavior elsewhere, what seems likely to be novel about this test is that you are using [["B"]]
; this calls the function _gotitem
in the groupby code. So I'd suggest a name like: test_groupby_agg_dict_with_gotitem
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.
getitem (as in the dunder __getitem__
) would also work - actually, the more I think about it, the more I'd prefer getitem.
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.
Done!
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.
lgtm
Thanks @talukder-sowrov! |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.