Skip to content
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

False positive in 0.1.12 PD002 with pyvista inplace #9491

Closed
tarrox opened this issue Jan 12, 2024 · 1 comment · Fixed by #9495
Closed

False positive in 0.1.12 PD002 with pyvista inplace #9491

tarrox opened this issue Jan 12, 2024 · 1 comment · Fixed by #9495
Assignees
Labels
bug Something isn't working

Comments

@tarrox
Copy link

tarrox commented Jan 12, 2024

Problem:
Pyvista supports to change meshes inplace, which triggers the PD002 rule for pandas.

Ruff Version: ruff 0.1.12

Dependencies:

  • pyvista: 0.43.1

Config:

line-length = 100
ignore = [
    "F722",
    "G004",
]
select = [
    "E","F","W","N","D","I","G","T","PT","RET","PTH","FIX","PD","RUF","YTT","BLE","B","A","EXE","SLF","PIE",
]
"""Nothing."""
from pyvista import examples


def main():
    """Nothing."""
    mesh = examples.download_crater_topo()
    mesh.rotate_z(45, inplace=True)

    mesh.plot()

if __name__ == "__main__":
    main()
@charliermarsh charliermarsh added the bug Something isn't working label Jan 12, 2024
@charliermarsh
Copy link
Member

We can, at the very least, curate a list of methods that should be eligible to trigger this.

@charliermarsh charliermarsh self-assigned this Jan 12, 2024
charliermarsh added a commit that referenced this issue Jan 12, 2024
## Summary

This should reduce false positives like
#9491, by ignoring methods that
are clearly not on a DataFrame.

Closes #9491.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants