Skip to content

Conversation

phofl
Copy link
Member

@phofl phofl commented Jun 20, 2023

@phofl phofl added this to the 2.1 milestone Jun 20, 2023
@phofl phofl requested a review from jorisvandenbossche June 20, 2023 20:16
@jorisvandenbossche jorisvandenbossche changed the title CoW: Add lazy copy to eval ENH / CoW: Add lazy copy to eval Jun 21, 2023
target = env.target.copy()
target = env.target
if isinstance(target, NDFrame):
target = target.copy(deep=not using_copy_on_write())
Copy link
Member

Choose a reason for hiding this comment

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

You could also do target.copy(deep=None) here, which will have the same effect (without having to import using_copy_on_write here). I think this is how we did it in most places that had a self.copy() in the method

Copy link
Member Author

Choose a reason for hiding this comment

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

Forgot about that, thx

@jorisvandenbossche
Copy link
Member

The typing error is related? (don't see it on main, and it happens in the eval.py file, although I don't see how it actually can be related ..)

@jorisvandenbossche
Copy link
Member

The ignore didn't seem to have worked ..

@phofl phofl merged commit e34a111 into pandas-dev:main Jun 29, 2023
@phofl phofl deleted the cow_eval branch June 29, 2023 10:37
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
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