8000 Fix Up Typing in GroupBy by WillAyd · Pull Request #26089 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Fix Up Typing in GroupBy #26089

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 8 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension 8000

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into groupby-typing
  • Loading branch information
WillAyd committed Apr 17, 2019
commit 4578fb1c0d40bb0c1bcb8ba4381b802cdbf18e7b
6 changes: 0 additions & 6 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ ignore_errors=True
[mypy-pandas.core.config_init]
ignore_errors=True

[mypy-pandas.core.frame]
ignore_errors=True

[mypy-pandas.core.generic]
ignore_errors=True

[mypy-pandas.core.indexes.base]
ignore_errors=True

Expand Down
13 changes: 0 additions & 13 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,6 @@ def _cython_agg_blocks(self, how, alt=None, numeric_only=True,

return new_items, new_blocks

def _get_data_to_aggregate(self):
obj = self._obj_with_exclusions
if self.axis == 0:
return obj.swapaxes(0, 1)._data, 1
else:
return obj._data, self.axis

def _post_process_cython_aggregate(self, obj):
# undoing kludge from below
if self.axis == 0:
obj = obj.swapaxes(0, 1)
return obj

def aggregate(self, func, *args, **kwargs):
Copy link
Member Author

Choose a reason for hiding this comment

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

The reason for this change is that MyPy was complaining about the signature here differening from what's defined in SelectionMixin. Th 7FCD is aligns the signatures and is arguably more readable.

Counter argument is that this is an API change, but this actually would match the docs

image

Copy link
Contributor

Choose a reason for hiding this comment

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

this is ok, pls add a note in the whatsnew about this though


_level = kwargs.pop('_level', None)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0