Skip to content
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: Raise informative error message when join would introduce duplicate column name #15042

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

MarcoGorelli
Copy link
Collaborator

closes #15035

The example in that issue would now show:

polars.exceptions.DuplicateError: column with name 'c_right' already exists.

You may want to try:
- renaming the column prior to joining
- using `suffix` to specify a suffix different to the default one (`_right`)

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Mar 13, 2024
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.01%. Comparing base (bbaf341) to head (b9f45e3).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15042      +/-   ##
==========================================
- Coverage   81.01%   81.01%   -0.01%     
==========================================
  Files        1338     1338              
  Lines      173601   173601              
  Branches     2460     2461       +1     
==========================================
- Hits       140645   140635      -10     
- Misses      32487    32496       +9     
- Partials      469      470       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MarcoGorelli MarcoGorelli marked this pull request as ready for review March 13, 2024 18:42
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

Good improvement! Minor nitpicks on the message.

crates/polars-ops/src/frame/join/general.rs Outdated Show resolved Hide resolved
crates/polars-ops/src/frame/join/general.rs Outdated Show resolved Hide resolved
Co-authored-by: Stijn de Gooijer <stijndegooijer@gmail.com>
@ritchie46
Copy link
Member

Really nice one @MarcoGorelli. I took the liberty to merge @stinodego's suggestions.

@stinodego stinodego changed the title feat: raise informative error message when join would introduce duplicate column name feat: Raise informative error message when join would introduce duplicate column name Mar 14, 2024
@stinodego stinodego merged commit 377fc4c into pola-rs:main Mar 14, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

duplicate column names found error message isn't Rust-y enough
3 participants