Skip to content

Commit ca9e757

Browse files
ENH #61033: Add coalesce_keys option to DataFrame.join
This adds a coalesce_keys keyword to DataFrame.join to allow preservation of both join key columns (id and id_right), instead of automatically coalescing them into a single column. This is especially useful in full outer joins, where retaining information about unmatched keys from both sides is important. Example: df1.join(df2, on=id, coalesce_keys=False) This will result in both id and id_right columns being preserved, rather than merged into a single id. Includes: - Modifications to join internals (core/reshape/merge.py) - A dedicated test file (test_merge_coalesce.py) covering: - Preservation of join keys when coalesce_keys=False - Comparison with default behavior (coalesce_keys=True) - Full outer joins with asymmetric key presence Co-authored-by: Maria Pereira <[email protected]>
1 parent 1f6f42a commit ca9e757

File tree

3 files changed

+337
-55
lines changed

3 files changed

+337
-55
lines changed

0 commit comments

Comments
 (0)