-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ruff] Use DiagnosticTag for more pyflakes and panda rules
#20801
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
[ruff] Use DiagnosticTag for more pyflakes and panda rules
#20801
Conversation
|
| // PD007 | ||
| "ix" if checker.is_rule_enabled(Rule::PandasUseOfDotIx) => { | ||
| checker.report_diagnostic(PandasUseOfDotIx, range) | ||
| let mut diagnostic = checker.report_diagnostic(PandasUseOfDotIx, range); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I'm not sure about using deprecated here. The method isn't deprecated according to pandas documentation; they only advise against it. To me, that makes this rule similar to other rules that recommend one pattern over another because it's less error prone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PandasUseOfDotIx rule is other one PD007 https://docs.astral.sh/ruff/rules/pandas-use-of-dot-ix. It says:
The .ix method is deprecated as its behavior is ambiguous.
So it seems that the method is deprecated?
crates/ruff_linter/src/rules/pyflakes/rules/unused_annotation.rs
Outdated
Show resolved
Hide resolved
remove some tags
207d914 to
cb59ef8
Compare
|
@MichaReiser Thank you for the review. I have addressed your comments. |
|
Thanks |
Summary
Fixes a part of #20590 and follow up to #20734
Rolling out DiagnosticTag to every existing rule in one go would complicate the review, so in this pull request I’ve limited the changes to flake8 and numpy. (RUF100, PD011, F811, F842, RUF029)
Test Plan