-
-
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
DOC: Add note for copy keywords for Copy-on-Write #56033
Conversation
@@ -6428,6 +6428,15 @@ def astype( | |||
Return a copy when ``copy=True`` (be very careful setting | |||
``copy=False`` as changes to values then may propagate to other | |||
pandas objects). | |||
|
|||
.. note:: |
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.
Can you make this warning a shared docstring?
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.
Personally I find shared docstrings quite annoying (and untransparant, difficult to understand), so while it's nice to deduplicate and only have 1 place to update this note, I am also fine with simply copy-pasting this note multiple times once we have finalized its wording.
(certainly for methods that right now don't yet make use of shared docstrings)
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.
Yeah I don't like them either
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.
Looks good to me.
I might want to say something like: "in the future this will no longer copy by default, so you don't need to specify this keyword", but the problem is in being both succinct and accurate, because of course that isn't fully true, we will copy later on. Which is what your "lazy copy" covers, but then I don't know how many people will fully understand that.
Do we want to also make use of this note to mention "you can already get that future behaviour by enabling CoW, see ...` ?
Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
I've added the enable cow already (big fan of this) and added a defers the copy to the lazy copy mechanism (we also link to the cow docs where this is explained in more detail) |
going ahead with the others now |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Starting with one method to figure out wording. Will add for the remaining ones after this one