-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refactor groupby to use classes #155
Refactor groupby to use classes #155
Conversation
5d44d44
to
94f4b83
Compare
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.
Very nice work! Indeed this is easier to reason about.
There's one thing missing that's needed for the async world but not the regular groupby
: an aclose
method on GroupBy
and _Grouper
. The generator implementation got them for free (though I'm not entirely sure whether the group.aclose
behaviour was actually correct...).
As far as I can tell, _Grouper.aclose
should just set state.current_group
to None
. GroupBy.aclose
should close the current group as well as the iterator.
Are you sure? The What will call |
Okay, I just re-familiarised myself with the |
94f4b83
to
c891263
Compare
Implementations added; |
The implementation is closely modelled on the cpython C implementation of the groupby iterator.
c891263
to
5d23d88
Compare
Thanks, this looks good to go!
The |
The implementation is closely modelled on the cpython C implementation of the groupby iterator. This should be easier to reason about by humans and code scanners alike.
Closes #96