Skip to content
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

Avoid returning deep copies with pandas 3.0 (with Copy-on-Write) #3298

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jorisvandenbossche
Copy link
Member

Avoiding some deep copies in case of pandas >= 3.0. Starting with pandas 3.0, most methods on a DataFrame (like rename or (re)set_index) will not return a hard copy of the data, but only a shallow copy (protected by Copy-on-Write, to ensure it still behaves as a copy).

We can follow that new behaviour in our own methods, so checking for a few cases where right now we always do a copy() of self before adjusting and returning it.

@martinfleis
Copy link
Member

This has caused some dev failures related to CRS management.

@martinfleis martinfleis added this to the 1.0 milestone May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants