CLN: Use dedup_names for column name mangling in Python parser (#50371)
### What does this PR do?

Replaces manual deduplication logic in the Python parser with the `dedup_names` utility from `pandas.io.common`.

### Why is this important?

- Improves consistency and maintainability
- Simplifies internal logic
- Addresses issue #50371

---

### Checklist
- [x] closes #50371
- [x] Tests added and passed (existing tests cover the change)
- [x] All code checks passed (CI will run static checks)
- [ ] Added type annotations (n/a)
- [ ] Added whatsnew entry (not needed for refactor)



Hi maintainers 👋

This PR replaces manual deduplication logic with the shared `dedup_names` utility. Parser-related tests pass as expected ✅

Some CI checks failed due to network-based tests (`test_network.py`, `test_url`, etc.), which appear unrelated to my change and are known to be flaky or environment-dependent.

Please let me know if you’d like anything else adjusted. Thanks!

 can you merge main and see if the CI passes 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
> <https://github.com/pandas-dev/pandas/pull/61670#discussion_r2205712915>:
>
> > -                    # 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
> <https://github.com/pandas-dev/pandas/pull/61670#pullrequestreview-3017613477>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BCH5XYIIYOXP5ISXTVC73533IQEOLAVCNFSM6AAAAAB7NLXPE2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTAMJXGYYTGNBXG4>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
