Skip to content

CLN: Fix code formatting to address pre-commit and build failures #61609

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

Closed
wants to merge 1 commit into from

Conversation

Neer-Pathak
Copy link

Run ruff --fix and ruff format to fix style issues flagged by pre-commit.
This resolves common RUF003 errors (e.g., ambiguous hyphens) seen across multiple PRs.

@Neer-Pathak
Copy link
Author

I think as per the documentation I should rename my commit to CLN: Code cleanup.

@Neer-Pathak Neer-Pathak changed the title STYLE: Apply formatting fixes from ruff CLN: Fix code formatting to address pre-commit and build failures Jun 8, 2025
@datapythonista
Copy link
Member

Not sure where you saw pre-commit flagging issues, but the CI is green for main, I think all is good (based on our validations).

Maybe you run things locally with different versions of the validation tools?

@Neer-Pathak
Copy link
Author

Not sure where you saw pre-commit flagging issues, but the CI is green for main, I think all is good (based on our validations).

Maybe you run things locally with different versions of the validation tools?

Yeah makes sense — but even on a clean main, pre-commit fails for me unless I run Ruff. Even adding just a comment triggers it, so I don’t think it’s a version mismatch. Might be that pre-commit is catching things CI isn’t?

Also seeing the docstring validation failing — happy to fix it if needed, or we can just drop the PR if it’s not worth changing right now. Let me know what you prefer!

@datapythonista
Copy link
Member

We do check pre-commit in the CI, with main and a clean install of the pre-commit tools if I'm not wrong. And it's green for main, so it seems like you've got something different than our CI locally.

I'll run pre-commit to this PR to see how it looks like.

@datapythonista
Copy link
Member

pre-commit.ci autofix

"""

def missing_whitespace_around_arithmetic_operator(self) -> None:
"""
Examples
--------
>>> 2+5
>>> 2 + 5
Copy link
Member

Choose a reason for hiding this comment

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

You are fixing those, which are incorrect docstrings used to test incorrect docstrings. All these changes need to be reverted. This is why the CI is red for your PR.

@Neer-Pathak
Copy link
Author

Ahh got it — makes sense now. I’ll revert those changes to the test docstrings. Thanks for pointing that out!

@Neer-Pathak
Copy link
Author

The problem was that after making the code change, I was manually running ruff format and ruff check --fix, which applied to the entire directory. After running pre-commit, I realized that everything outside the pandas/ directory is skipped, along with pandas/tests/, when using pre-commit run --all-files.

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

Successfully merging this pull request may close these issues.

2 participants