Skip to content

Conversation

@jbrockmendel
Copy link
Member

cc @WillAyd @jreback, orthogonal to other groupby PRs.

@gfyoung gfyoung added Groupby Internals Related to non-user accessible pandas implementation Refactor Internal refactoring of code labels Nov 9, 2019
for name, obj in self._iterate_slices():
if self.grouper.ngroups == 0:
# agg_series below assumes ngroups > 0
# 3 test cases get here
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: somewhat on the fence regarding the necessity and usefulness of this comment

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough. its for my own reference in trying to move these checks earlier

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment on another PR but would ideally not special case things like this in groupby functions. Is there an actual issue in allowing this to follow the same code paths as when ngroups is non-zero?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WillAyd that goal is the reason for the "3 test cases" comment (which I'll remove). I want to identify the cases that get here and make this check unnecessary. But its much clearer to do this check and not end up with None on L914 and not be clear on how that happened.

@jreback jreback added this to the 1.0 milestone Nov 12, 2019
@jreback jreback merged commit b7346ad into pandas-dev:master Nov 12, 2019
@jreback
Copy link
Contributor

jreback commented Nov 12, 2019

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Groupby Internals Related to non-user accessible pandas implementation Refactor Internal refactoring of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants