Skip to content

WEB: Replace os.path with pathlib.Path in pandas_web.py #61604

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

Merged
merged 3 commits into from
Jun 13, 2025

Conversation

iabhi4
Copy link
Contributor

@iabhi4 iabhi4 commented Jun 7, 2025

Replaces os.path with pathlib.Path in pandas_web.py, as suggested by @datapythonista in 61578. No functional changes, verified site generation remains correct

  • Ran pre-commit check

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Looks good, but we need to make everything that is a path a pathlib object when it's first created. Not create it as a string and cast it for every operation.

@iabhi4 iabhi4 force-pushed the refactor-pathlib-clean branch from d1a990f to 9492f87 Compare June 9, 2025 02:45
@iabhi4
Copy link
Contributor Author

iabhi4 commented Jun 9, 2025

Thanks for the review! updated to make sure all paths are created as Path early and used consistently. Removed redundant casts too.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Looks good. Added few comments, but very nice clean up

@iabhi4 iabhi4 force-pushed the refactor-pathlib-clean branch from 9492f87 to e7a9b44 Compare June 9, 2025 20:09
@iabhi4
Copy link
Contributor Author

iabhi4 commented Jun 9, 2025

Addressed all the latest comments, switched to Path.rglob, cleaned up base_url, and ensured consistent Path usage. Let me know if anything else looks off, I also retested on local after the changes

@iabhi4 iabhi4 requested a review from datapythonista June 9, 2025 20:14
@datapythonista datapythonista added the Web pandas website label Jun 11, 2025
@datapythonista datapythonista changed the title REF: Replace os.path with pathlib.Path in pandas_web.py WEB: Replace os.path with pathlib.Path in pandas_web.py Jun 13, 2025
@datapythonista
Copy link
Member

/preview

Copy link
Contributor

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/61604/

@datapythonista datapythonista merged commit 61d9976 into pandas-dev:main Jun 13, 2025
8 checks passed
@datapythonista
Copy link
Member

Thanks for the clean up here @iabhi4 , very nice PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Web pandas website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants