-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat!: Preserve left and right join keys in outer joins #12963
Conversation
col().count()
c7255e2
to
e1569ae
Compare
642b538
to
c467ab7
Compare
9e79e11
to
32e3522
Compare
This makes a lot of sense. Btw this breaking change was not listed in the release info and took me a bit of time to track. |
@yusufshalaby it's listed here: and also is the first item appearing in the upgrade guide: https://pola-rs.github.io/polars/releases/upgrade/0.20/ Perhaps you're looking at the wrong release notes? |
Sorry! Didn't read it carefully enough. Thanks for clarifying. |
echoing the comments from #9335 , should this also be implemented for other join types? I've been tripped up a few times by left joins deleting my rh join column |
Will add add an option for left joins later |
Previously, the result of an outer join did not contain the join keys of the left and right frames.
Rather, it contained a coalesced version of the left key and right key.
This loses information and does not conform to default SQL behavior.
The behavior has been changed to include the original join keys.
Name clashes are solved by appending a suffix (
_right
by default) to the right join key name.The previous behavior can be retained by setting
how="outer_coalesce"
.Example
Before:
After: