Skip to content

Ruff format fails on test_query_eval.py  #62701

@santhoshbethi

Description

@santhoshbethi

Running ruff format or ruff format --check fails on the following code block in
pandas/tests/frame/test_query_eval.py

`df = DataFrame(
{
"A": range(3),
"B": range(3),
"C": range(3)
}
).rename(columns={"B": "A"})

res = df.query("C == 1", engine=engine, parser=parser)

expect = DataFrame(
[[1, 1, 1]],
columns=["A", "A", "C"],
index=[1]
)
`

steps to reproduce:
git checkout main & ruff format --check

Expected behavior
ruff format --check should pass cleanly without reporting reformatting issues.

Actual Behavior:
ruff format reports that the file would be reformatted, causing formatting checks to fail in CI pipelines.
Example output:
Would reformat: pandas/tests/frame/test_query_eval.py
1 file would be reformatted, 1552 files already formatted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions