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

[PD010] - False positives with polarsdataframes #14301

Closed
jlopezpena opened this issue Nov 12, 2024 · 1 comment
Closed

[PD010] - False positives with polarsdataframes #14301

jlopezpena opened this issue Nov 12, 2024 · 1 comment

Comments

@jlopezpena
Copy link

ruff version 0.7.3, pandas linting rules PD can trigger when dealing with objects from other libraries, like polars.

Minimal example:

import polars as pl

pl_df = pl.DataFrame([{"a": 1, "b": 2}, {"a": 3, "b": 4}])
pl_df.pivot(on="a", values="b")

This code raises a warning for rule [PD010](https://docs.astral.sh/ruff/rules/pandas-use-of-dot-pivot-or-unstack):

`.pivot_table` is preferred to `.pivot` or `.unstack`; provides same functionality

The warning is invalid, because the dataframe is not a pandas dataframe (and polars does not even have a pivot_table method!)

@jlopezpena
Copy link
Author

duplicate of #6432

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

No branches or pull requests

1 participant