Skip to content
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

REF: Use _python_apply_general internally #52342

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

rhshadrach
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

For #7155, avoiding calling the public .apply to raise deprecation warnings.

@rhshadrach rhshadrach added Refactor Internal refactoring of code Groupby Apply Apply, Aggregate, Transform, Map labels Apr 1, 2023

def __getattr__(self, name: str):
def attr(*args, **kwargs):
def f(self):
return getattr(self.plot, name)(*args, **kwargs)

return self._groupby.apply(f)
return self._groupby._python_apply_general(f, self._groupby._selected_obj)
Copy link
Member

Choose a reason for hiding this comment

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

does selected_obj vs obj_with_exclusions matter here? think we're mostly standardizing on the latter

Copy link
Member Author

@rhshadrach rhshadrach Apr 2, 2023

Choose a reason for hiding this comment

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

Yes - this is preserving current behavior that will then be deprecated (#7155). Enforcing that deprecation will allow us to use obj_with_exclusions.

@mroeschke mroeschke added this to the 2.1 milestone Apr 6, 2023
@mroeschke mroeschke merged commit 9c89702 into pandas-dev:main Apr 6, 2023
@mroeschke
Copy link
Member

Thanks @rhshadrach

topper-123 pushed a commit to topper-123/pandas that referenced this pull request Apr 6, 2023
@rhshadrach rhshadrach deleted the ref_gb_apply branch April 7, 2023 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map Groupby Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants