Skip to content

TYP: Add type hint for BaseGrouper in groupby._Groupby #29675

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

Conversation

topper-123
Copy link
Contributor

Add a type hint in class _Groupby for BaseGrouper to aid navigating the code base.

@topper-123 topper-123 force-pushed the add_type_for_GroupBy.grouper branch from 2d433c4 to 4d0cd8d Compare November 17, 2019 19:32
@topper-123 topper-123 force-pushed the add_type_for_GroupBy.grouper branch from 4d0cd8d to 30bdcab Compare November 17, 2019 20:15
@topper-123 topper-123 added Typing type annotations, mypy/pyright type checking Groupby labels Nov 17, 2019
@topper-123 topper-123 modified the milestones: 1.0, 0.24.3 Nov 17, 2019
@topper-123 topper-123 merged commit debaf9a into pandas-dev:master Nov 17, 2019
@topper-123 topper-123 deleted the add_type_for_GroupBy.grouper branch November 17, 2019 20:55
@@ -442,7 +442,7 @@ def get_grouper(
observed: bool = False,
mutated: bool = False,
validate: bool = True,
) -> Tuple[BaseGrouper, List[Hashable], FrameOrSeries]:
) -> "Tuple[ops.BaseGrouper, List[Hashable], FrameOrSeries]":
Copy link
Member

Choose a reason for hiding this comment

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

any reason to add quotes? don't we lose the black formatting checking by doing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without the quotes we get a circular import error, so needs to be quoted.

Reksbril pushed a commit to Reksbril/pandas that referenced this pull request Nov 18, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants