Skip to content

CLN: Break up aggregate.transform #36618

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 1 commit into from
Sep 26, 2020

Conversation

rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Sep 25, 2020

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Precursor to #36478. Just breaks up transform without any code changes.

@rhshadrach rhshadrach mentioned this pull request Sep 25, 2020
5 tasks
@rhshadrach rhshadrach added Apply Apply, Aggregate, Transform, Map Clean labels Sep 25, 2020
Copy link
Member

@arw2019 arw2019 left a comment

Choose a reason for hiding this comment

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

Just an idea but it looks like we have a bunch of functions with the same signature which differ by the type of func arg. Would it make sense to use single dispatch?

@rhshadrach
Copy link
Member Author

Thanks for the suggestion @arw2019. In this particular case, I think not. In #36478, we'll change e.g. isinstance(func, dict) to using is_dict_like. I believe that makes singledispatch not viable.

@arw2019
Copy link
Member

arw2019 commented Sep 26, 2020

Thanks for the suggestion @arw2019. In this particular case, I think not. In #36478, we'll change e.g. isinstance(func, dict) to using is_dict_like. I believe that makes singledispatch not viable.

Right, that makes sense.

Another question, should transform_dict_like and transform_str_or_callable be underscored? Since AFAICT they're private methods

@jreback jreback added this to the 1.2 milestone Sep 26, 2020
@jreback
Copy link
Contributor

jreback commented Sep 26, 2020

Thanks for the suggestion @arw2019. In this particular case, I think not. In #36478, we'll change e.g. isinstance(func, dict) to using is_dict_like. I believe that makes singledispatch not viable.

Right, that makes sense.

Another question, should transform_dict_like and transform_str_or_callable be underscored? Since AFAICT they're private methods

this entire hierarchy is private pandas/core/* (yes it doesn't actually look like it, but its been document this way for a long time)

@jreback jreback merged commit 027f365 into pandas-dev:master Sep 26, 2020
@jreback
Copy link
Contributor

jreback commented Sep 26, 2020

thanks @rhshadrach

happy to have typing passes as well

@rhshadrach rhshadrach deleted the transform_breakup branch October 11, 2020 13:22
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map Clean
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants