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

fix(python): Raise for overlapping index/column names in pandas dataframes post string coercion #17628

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

tylerriccio33
Copy link
Contributor

Hi Polars team, this pr does 3 main things. First, it solves for #15938 and #16023 , by checking the stringified index names for overlap w/column names. Second, it solves for duplicated index names, post string conversion. For example, an index of 0 and '0' would not be caught without this explicit check. Third, I combine this logic with the code I wrote for issue #16025 , because I considered this all a part of the same general problem.

I altered some unit tests to include the new error message, two of which I already altered for my pr on #16025 . I wrote/borrowed a new unit test that was written directly from the desired behavior in #15938 .

Let me know if you need anything else. I'd love for any feedback on the code, if there's anything you'd change.

Thank you.

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.

Project coverage is 80.69%. Comparing base (b85654e) to head (e1911c1).

Files Patch % Lines
py-polars/polars/_utils/construction/dataframe.py 76.92% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17628   +/-   ##
=======================================
  Coverage   80.69%   80.69%           
=======================================
  Files        1484     1484           
  Lines      195409   195418    +9     
  Branches     2779     2780    +1     
=======================================
+ Hits       157679   157692   +13     
+ Misses      37220    37215    -5     
- Partials      510      511    +1     

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

Copy link
Member

@ritchie46 ritchie46 left a comment

Choose a reason for hiding this comment

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

Seems good. Thanks!

@ritchie46 ritchie46 merged commit f90753b into pola-rs:main Jul 15, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants