Skip to content

REF: use CoW helpers more #53911

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
Jul 13, 2023
Merged

Conversation

jbrockmendel
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.

@jbrockmendel
Copy link
Member Author

@phofl in Block._maybe_copy there is a path where we can pass deep=False to Block.copy. i think we could simplify things if instead we just returned self there. would that be OK?

@phofl
Copy link
Member

phofl commented Jun 28, 2023

I’ll have to look into this more, there are scenarios where this could be problematic. This ties a bit into my todo list that’s related to replace. Might get to this over the weekend or next week

@mroeschke mroeschke added Refactor Internal refactoring of code Copy / view semantics labels Jun 28, 2023
@jbrockmendel
Copy link
Member Author

there are scenarios where this could be problematic

Yah, just remembered there are a couple places where we set block.values post-__init__. Refactoring to avoid those might make that safer. I don't think this PR should be affected though.

@jbrockmendel
Copy link
Member Author

i think the helper here should be OK?

@phofl phofl added this to the 2.1 milestone Jul 13, 2023
@phofl phofl merged commit 3d7a44a into pandas-dev:main Jul 13, 2023
@jbrockmendel jbrockmendel deleted the ref-has_refs-3 branch July 13, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Copy / view semantics Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants