Skip to content

BUG: Use self._constructor_sliced in df._reduce to respect subclassed… #30945

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 9 commits into from
Jan 24, 2020
Merged

BUG: Use self._constructor_sliced in df._reduce to respect subclassed… #30945

merged 9 commits into from
Jan 24, 2020

Conversation

EmilianoJordan
Copy link

@EmilianoJordan EmilianoJordan commented Jan 12, 2020

… types. (GH25596)

Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

Thanks @EmilianoJordan for the PR. will need whatsnew once #30907 is merged.

@simonjayhawkins simonjayhawkins added Bug Numeric Operations Arithmetic, Comparison, and Logical operations labels Jan 12, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Jan 12, 2020
@EmilianoJordan
Copy link
Author

Thanks @EmilianoJordan for the PR. will need whatsnew once #30907 is merged.

Subscribed to #30907 to know when I can do this. Also, updated the initial pull request comment to reflect that this has not been completed.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. pls add a whatsnew note for 1.1, you can put in the bug fix section for reshaping.

@@ -140,7 +140,7 @@ Groupby/resample/rolling
Reshaping
^^^^^^^^^

-
- Bug in :meth:`DataFrame._reduce` not returning subclassed data type effecting all numeric and boolean reduction methods. (:issue:`25596`)
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 not a public method, can you update with something a user would want to know, e.g. DataFrame.sum() etc.

Copy link
Author

Choose a reason for hiding this comment

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

List all 12 methods then?

Copy link
Author

Choose a reason for hiding this comment

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

I'm working on a more comprehensive review of subclassing. How about I just add that to this PR and list all the methods? It'll be ~20 methods, but it'll get it all out of the way in one go.

Copy link
Contributor

Choose a reason for hiding this comment

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

u can list if u want or just sat reduction methods

@jreback jreback merged commit bd6b395 into pandas-dev:master Jan 24, 2020
@jreback
Copy link
Contributor

jreback commented Jan 24, 2020

thanks @EmilianoJordan

@EmilianoJordan EmilianoJordan deleted the subclass-reduce branch January 24, 2020 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pandas.DataFrame.sum() returns wrong type for subclassed pandas DataFrame
3 participants