-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
CoW: Ignore copy=True when copy_on_write is enabled #51464
Conversation
This basically closes #50535? (although maybe not every method listed there is already covered) |
I actually forgot about this issue. I double checked, we covered every case except transpose (added a test for this). So should be good to close when this is merged |
if not using_copy_on_write or axis in [0, "index"]: | ||
assert comb.index is not ser.index | ||
else: | ||
assert comb.index is ser.index |
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.
Not for this PR since we already do it for the copy=False case as well (and I suppose it is a general issue). But I am not sure the index should be identical here. An index' attributes are still mutable (eg setting the name), so we should maybe start creating new Index objects for the same data in such cases.
Sidenote: we should maybe discuss in general how Index objects fit into CoW, since those don't use blocks (and thus don't participate in the refs?)
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 good point
I took a shot at index data in #51803, it’s only a draft for now till we agree that we would want to do this
Thanks @phofl |
…n_write is enabled) (#51849) Backport PR #51464: CoW: Ignore copy=True when copy_on_write is enabled Co-authored-by: Patrick Hoefler <[email protected]>
copy
keyword in DataFrame/Series methods #50535 (Replace xxxx with the GitHub issue number)doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.