-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Conversation
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! Just one left-over comment
pandas/conftest.py
Outdated
@@ -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 |
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.
I suppose this is a leftover from local testing?
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.
Yes, thanks for noticing
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.
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.
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 agreed, did this when running tests in PyCharm
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.
Ah, I can't speak for PyCharm ;)
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.