-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fixed metadata propagation in Dataframe.apply (issue #28283) #44041
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
Co-authored-by: Mohamad Rkein <[email protected]> Co-authored-by: Rafael Rodrigues <[email protected]>
4aaf3c8
to
3112a5a
Compare
this appears to have xpassed some previously xfailed tests. @moha-rk you may need to adjust some other tests (as they maybe indirectly calling .apply) |
Thank you for your feedback, @jreback. I didn't notice the 'F's that appeared after my changes. The method As for "mode()", the same thing happens when it's called by a DataFrame (pandas/core/frame.py). However, there's a catch. When "mode()" is called directly from a Series (pandas/core/base.py), this apply call doesn't exist. This is a problem because "Series.mode()" returns a Series containing the mode(s). I created a test with the "not_implemented_mark" to observe this behaviour. I don't know if calling finalize on the Series.mode() function is a good idea, since this would cause it to be called one time for each column on the DataFrame call. Do you have any suggestion? For now, I'll leave it with the said mark. Finally, the last method that changed was "DataFrame.transform()". This function creates a "FrameApply" object, and calls its function ".transform()". When following the series of function calls, we end on "transform_str_or_callable()" (pandas/core/apply.py), which uses the "DataFrame.apply()" method at its end, propagating the attributes. I removed the "not_implemented_mark". |
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.
pls also merge master
Co-authored-by: Mohamad Rkein [email protected]
Co-authored-by: Rafael Rodrigues [email protected]
In reference to #28283