-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
CLN: Use dedup_names for column name mangling in Python parser (#50371) #61670
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
base: main
Are you sure you want to change the base?
Conversation
Hi maintainers 👋 This PR replaces manual deduplication logic with the shared Some CI checks failed due to network-based tests ( Please let me know if you’d like anything else adjusted. Thanks! |
can you merge main and see if the CI passes |
self.dtype.update({col: self.dtype.get(old_col)}) | ||
this_columns[i] = col | ||
counts[col] = cur_count + 1 | ||
from pandas.io.common import dedup_names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this import go at the top of the file
else: | ||
cur_count = counts[col] | ||
|
||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this chunk isn't present in dedup_names?
Yeah sir, I will try to merge and see if the CI passes
…On Tue, 15 Jul, 2025, 1:34 am jbrockmendel, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pandas/io/parsers/python_parser.py
<#61670 (comment)>:
> - # TODO: Use pandas.io.common.dedup_names instead (see #50371)
- for i in col_loop_order:
- col = this_columns[i]
- old_col = col
- cur_count = counts[col]
-
- if cur_count > 0:
- while cur_count > 0:
- counts[old_col] = cur_count + 1
- col = f"{old_col}.{cur_count}"
- if col in this_columns:
- cur_count += 1
- else:
- cur_count = counts[col]
-
- if (
looks like this chunk isn't present in dedup_names?
—
Reply to this email directly, view it on GitHub
<#61670 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BCH5XYIIYOXP5ISXTVC73533IQEOLAVCNFSM6AAAAAB7NLXPE2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTAMJXGYYTGNBXG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
What does this PR do?
Replaces manual deduplication logic in the Python parser with the
dedup_names
utility frompandas.io.common
.Why is this important?
Checklist