Skip to content

REF: Grouper.grouper -> Grouper._gpr_index #41540

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

Merged
merged 2 commits into from
May 21, 2021

Conversation

jbrockmendel
Copy link
Member

ATM we set self.grouper in both _get_grouper and in _set_grouper, but to different types. This changes _set_grouper to set _gpr_index instead, which we can type as Index | None

def ax(self) -> Index:
index = self._gpr_index
if index is None:
raise ValueError("_set_grouper must be called before ax is accessed")
Copy link
Contributor

Choose a reason for hiding this comment

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

this hit in tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, in practice we always call _set_grouper before accessing this

@jreback jreback added Groupby Refactor Internal refactoring of code labels May 18, 2021
@jreback jreback added this to the 1.3 milestone May 18, 2021
@jreback
Copy link
Contributor

jreback commented May 19, 2021

looks fine, pls rebase

@jbrockmendel
Copy link
Member Author

rebased + green

@jreback jreback merged commit 1f63790 into pandas-dev:master May 21, 2021
@jbrockmendel jbrockmendel deleted the cln-gb-2 branch May 21, 2021 17:19
TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants