Skip to content

Commit 33c8c75

Browse files
committed
[pandas-vet] Deprecate pandas-df-variable-name (PD901) (#18618)
Summary -- Deprecates PD901 as part of #7710. I don't feel particularly strongly about this one, though I have certainly used `df` as a dataframe name in the past, just going through the open issues in the 0.12 milestone. Test Plan -- N/a
1 parent 34dc8e0 commit 33c8c75

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crates/ruff_linter/src/codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
752752
(PandasVet, "013") => (RuleGroup::Stable, rules::pandas_vet::rules::PandasUseOfDotStack),
753753
(PandasVet, "015") => (RuleGroup::Stable, rules::pandas_vet::rules::PandasUseOfPdMerge),
754754
(PandasVet, "101") => (RuleGroup::Stable, rules::pandas_vet::rules::PandasNuniqueConstantSeriesCheck),
755-
(PandasVet, "901") => (RuleGroup::Stable, rules::pandas_vet::rules::PandasDfVariableName),
755+
(PandasVet, "901") => (RuleGroup::Deprecated, rules::pandas_vet::rules::PandasDfVariableName),
756756

757757
// flake8-errmsg
758758
(Flake8ErrMsg, "101") => (RuleGroup::Stable, rules::flake8_errmsg::rules::RawStringInException),

crates/ruff_linter/src/rules/pandas_vet/rules/assignment_to_df.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ use ruff_text_size::Ranged;
44

55
use crate::{Violation, checkers::ast::Checker};
66

7+
/// ## Deprecated
8+
///
9+
/// This rule has been deprecated as it's highly opinionated and overly strict in most cases.
10+
///
711
/// ## What it does
812
/// Checks for assignments to the variable `df`.
913
///

0 commit comments

Comments
 (0)