Skip to content

Conversation

jorisvandenbossche
Copy link
Member

xref #49473

The current copy=False only works when merging on the index; when merging on keys, we currently get a [0, 1, 2, ..] join index for both left and right, and so that still results in a copy (but that can be avoided using the is_range_indexer utility)

Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

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

lgtm.

As a follow up:

tests for left/right merges where only one side isn't copied

@phofl
Copy link
Member

phofl commented Feb 10, 2023

Ah mypy is complaining:

pandas/core/reshape/merge.py:155: error: Argument "copy" to "get_result" of "_MergeOperation" has incompatible type "Optional[bool]"; expected "bool"  [arg-type]

@phofl phofl merged commit 7986bc2 into pandas-dev:main Feb 11, 2023
@phofl
Copy link
Member

phofl commented Feb 11, 2023

thx @jorisvandenbossche

@phofl phofl added this to the 2.0 milestone Feb 11, 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