Skip to content

ENH/TST: expand copy-on-write to assign() method #50010

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

Merged
merged 1 commit into from
Dec 2, 2022

Conversation

seljaks
Copy link
Contributor

@seljaks seljaks commented Dec 2, 2022

Added copy-on-write to df.assign().

Progress towards #49473 via PyData pandas sprint.

@jorisvandenbossche jorisvandenbossche changed the title ENH/TST: expand copy-on-write to assign GH49473 ENH/TST: expand copy-on-write to assign() method Dec 2, 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!

df = DataFrame({"a": [1, 2, 3]})
df_orig = df.copy()
df2 = df.assign()
df2._mgr._verify_integrity()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
df2._mgr._verify_integrity()

For future tests, you can leave out this part (I don't think it is needed to repeat in every test)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted, will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants