feat: reduce duplicate fields on join #1184
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #1173
Rationale for this change
In the current version of the code when you do a join and there is a common
on
column name, then you end up with two columns in the output dataframe with ambiguous names. This is an annoyance for users where they have to work around by renaming the column to join on. With this change, it makes the interface more user friendly.What changes are included in this PR?
keep_duplicate_keys
if the user does not want to drop duplicate column nameson
and notjoin_on
Are there any user-facing changes?
Yes.
DataFrame.join()
by default will now only return a single column for duplicateon
keys. The user can revert to the previous version by settingkeep_duplicate_keys
toTrue
.