-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Fix the metadata propagation in Dataframe.std #52924
Conversation
Looks like there's typing issue which indicates this needs fixed at a lower level |
Yeah it seems so, i will figure it out |
Fix the typing problem by forcing the only propagation on Series |
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.
thanks for working on this! this is close
also, might be good to add a whatsnew note to 2.1.0?
pandas/core/frame.py
Outdated
else: | ||
return result |
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.
this should be unreachable, and looks like a case where we humans looking at the code can infer things which the type checker can't
I'd suggest
result = cast(Series, super().std(...)
return result.__finalize_(...)
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.
Thank you so much, Mr Gorelli! I appreciate your help so much, I will submit this:)
changes look good, if you add a whatsnew note to 2.1.0.rst we can get this in |
Sure! I will add it now, Sorry I forget to add |
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.
thanks @jiawei-zhang-a
Thanks @jiawei-zhang-a |
* Fix the metadata propagation both in Dataframe.std * Fix the typing problem by forcing propogation only on Series * From judge statement to cast * Add whatsnew
* Fix the metadata propagation both in Dataframe.std * Fix the typing problem by forcing propogation only on Series * From judge statement to cast * Add whatsnew
* Fix the metadata propagation both in Dataframe.std * Fix the typing problem by forcing propogation only on Series * From judge statement to cast * Add whatsnew
* Fix the metadata propagation both in Dataframe.std * Fix the typing problem by forcing propogation only on Series * From judge statement to cast * Add whatsnew
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.The goal here is to make progress on Various methods don't call call __finalize__ #28283.