-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: REF: Groupby refactor #46754
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
BUG: REF: Groupby refactor #46754
Conversation
78a014c
to
fb69376
Compare
fb69376
to
8a89333
Compare
I added a merge commit again because the CI run seemed to be failing because it was using an old version of the PR, before I updated the tests? Anyways, this PR seems to be innocent of any failing tests. |
OK, some of the tests (https://github.com/pandas-dev/pandas/runs/6011207511?check_suite_focus=true) seem to still not be picking up the changed tests and are failing? But some of them have picked up the modified tests and are therefore passing? Not sure what this means, is the CI being weird or does this actually mean I need to adjust the tests more because I'm missing something? |
@NickCrews - does the one failing test pass for you locally? |
This doesn't affect the behaviour, since the possible values are already restricted a few lines above this.
The return value is never used. Don't pretend that it is. Ideally we don't even hold this state inside the Grouper, it would make it easier to reason about. But just do this tiny change for now, still an improvement. See pandas-dev#46258 for more details.
All this changes I think is that now `dropna` is included in the `__repr__` output. See pandas-dev#46258 for more discussion. And move dropna up out of the "generated" attribute section into the "source" attribute section in the __init__
44984c0
to
3249b43
Compare
Poking into this showed that there was a second |
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.
Thanks for the PR! Looks good, one request.
@@ -413,7 +413,6 @@ def _set_grouper(self, obj: NDFrame, sort: bool = False): | |||
# "NDFrameT", variable has type "None") | |||
self.obj = obj # type: ignore[assignment] | |||
self._gpr_index = ax | |||
return self._gpr_index |
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 seems okay to me; the result of this method is indeed never used and it looks cleaner to not have a return. cc @jbrockmendel
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.
Thanks for the review @rhshadrach! FYI we talked about this a bit at #46258 (comment) if you want a bit more context
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.
Marking as resolved, since I'm worried the "changes requested" label might be keeping this out of your queue.
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 don't think it being resolved or not changes its appearance in e.g. pandas/pulls
or the GitHub notifications (not sure what else you might mean by queue 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.
That is what I meant (maybe you had filters for what to review next), but good to know. Thanks!
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, over to you @rhshadrach
little rebase to fix a merge conflict that appeared from the whatsnew changing in main |
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
hmm i think this needs to merge master once more |
oh nvm i was looking at an older version thanks @NickCrews |
Thanks @NickCrews! |
This is a follow-up, scaled back version of #46258, that hopefully should be easier to merge.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.