Skip to content

TST: clip inplace doesn't modify views with CoW #51402

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 4 commits into from
Feb 15, 2023

Conversation

lithomas1
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@lithomas1 lithomas1 added the Testing pandas testing functions or related to the test suite label Feb 15, 2023
@lithomas1 lithomas1 marked this pull request as ready for review February 15, 2023 18:43
@lithomas1 lithomas1 requested a review from phofl February 15, 2023 18:43
view = df[:]
df.clip(lower=2, inplace=True)

# Clip not actually inplace right now but could be
Copy link
Member

Choose a reason for hiding this comment

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

Can you do: TODO(CoW): ...

Copy link
Member

Choose a reason for hiding this comment

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

Ah no, could you add another test without a reference? I think it should pass after my where pr is in

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is not actually inplace even without CoW.

Copy link
Member

Choose a reason for hiding this comment

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

Yep you are correct. We should refactor this if we decide to keep inplace here

@phofl phofl merged commit 0fb84ae into pandas-dev:main Feb 15, 2023
@phofl
Copy link
Member

phofl commented Feb 15, 2023

thx @lithomas1

@phofl phofl added this to the 2.0 milestone Feb 15, 2023
@lithomas1 lithomas1 deleted the test-clip-inplace branch February 15, 2023 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Copy / view semantics Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants