-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Fix metadata propagation in reductions #53542
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
Conversation
if isinstance(result, Series): | ||
result = result.__finalize__(self, method="any") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only not a series when axis=None
? Or are there other cases where a DataFrame can be reduced to a scaler?
I'd slightly prefer if axis is not None
to this isinstance
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, but mypy won't be able to figure out that result is a Series without an isinstance/cast, though.
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Thanks @lithomas1 |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.