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

ENH: Add lazy copy for sort_index #50491

Merged
merged 2 commits into from
Jan 3, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Dec 29, 2022

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just one left-over comment

@@ -1903,6 +1903,7 @@ def using_copy_on_write() -> bool:
"""
Fixture to check if Copy-on-Write is enabled.
"""
pd.options.mode.copy_on_write = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this is a leftover from local testing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks for noticing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, for testing, you can set the env variable PANDAS_COPY_ON_WRITE=1 pytest ..., which is of course a bit verbose. What I do locally is that I have an alias in my bashrc, so I can just do COW pytest ..., and then it is quite easy to switch between COW pytest ... or pytest ... when I want to run a specific test while developing with both COW enabled or not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah agreed, did this when running tests in PyCharm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I can't speak for PyCharm ;)

@jorisvandenbossche jorisvandenbossche added this to the 2.0 milestone Jan 3, 2023
@jorisvandenbossche jorisvandenbossche merged commit f82bc3e into pandas-dev:main Jan 3, 2023
@phofl phofl deleted the cow_sort_index branch January 3, 2023 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants