Skip to content

Conversation

ntBre
Copy link
Contributor

@ntBre ntBre commented Jun 10, 2025

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

@ntBre ntBre added this to the v0.12 milestone Jun 10, 2025
@ntBre ntBre added rule Implementing or modifying a lint rule breaking Breaking API change labels Jun 10, 2025
@ntBre ntBre mentioned this pull request Jun 10, 2025
2 tasks
@ntBre ntBre force-pushed the brent/release-0.12.0 branch from aaf6c9b to 96913d1 Compare June 10, 2025 20:44
@ntBre ntBre requested a review from AlexWaygood as a code owner June 10, 2025 20:44
Copy link
Contributor

github-actions bot commented Jun 10, 2025

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -430 violations, +0 -0 fixes in 3 projects; 52 projects unchanged)

apache/airflow (+0 -72 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --no-preview --select ALL

- airflow-core/src/airflow/example_dags/tutorial_objectstorage.py:93:9: PD901 Avoid using the generic variable name `df` for DataFrames
- airflow-core/src/airflow/serialization/serializers/pandas.py:68:9: PD901 Avoid using the generic variable name `df` for DataFrames
- dev/airflow_perf/sql_queries.py:186:5: PD901 Avoid using the generic variable name `df` for DataFrames
- dev/stats/explore_pr_candidates.ipynb:cell 3:23:5: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/amazon/tests/unit/amazon/aws/transfers/test_sql_to_s3.py:232:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/amazon/tests/unit/amazon/aws/transfers/test_sql_to_s3.py:283:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/amazon/tests/unit/amazon/aws/transfers/test_sql_to_s3.py:326:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/apache/drill/tests/unit/apache/drill/hooks/test_drill.py:116:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/apache/drill/tests/unit/apache/drill/hooks/test_drill.py:99:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/apache/druid/tests/unit/apache/druid/hooks/test_druid.py:461:9: PD901 Avoid using the generic variable name `df` for DataFrames
... 62 additional changes omitted for project

apache/superset (+0 -267 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --no-preview --select ALL

- superset/charts/client_processing.py:110:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:112:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:113:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:114:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:124:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:132:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:136:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:141:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:144:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:147:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:206:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:213:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:341:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:343:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:91:5: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:95:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/database/uploaders/csv_reader.py:135:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/database/uploaders/excel_reader.py:108:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/dataset/importers/v1/utils.py:207:5: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/report/alert.py:179:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/report/alert.py:204:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/sql_lab/export.py:104:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/sql_lab/export.py:128:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_actions.py:104:5: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:268:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:275:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:279:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:287:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:602:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:658:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:665:17: PD901 Avoid using the generic variable name `df` for DataFrames
... 236 additional changes omitted for project

bokeh/bokeh (+0 -91 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --no-preview --select ALL

- examples/basic/annotations/band.py:21:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/annotations/band.py:25:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/annotations/polygon_annotation.py:12:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/areas/stacked_area.py:16:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/axes/datetime_axis.py:6:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/bars/intervals.py:14:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/interaction/legends/legend_hide.py:22:5: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/interaction/legends/legend_mute.py:11:5: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/models/daylight.py:24:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/models/trail.py:36:5: PD901 Avoid using the generic variable name `df` for DataFrames
... 81 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PD901 430 0 430 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -430 violations, +0 -0 fixes in 3 projects; 52 projects unchanged)

apache/airflow (+0 -72 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview --select ALL

- airflow-core/src/airflow/example_dags/tutorial_objectstorage.py:93:9: PD901 Avoid using the generic variable name `df` for DataFrames
- airflow-core/src/airflow/serialization/serializers/pandas.py:68:9: PD901 Avoid using the generic variable name `df` for DataFrames
- dev/airflow_perf/sql_queries.py:186:5: PD901 Avoid using the generic variable name `df` for DataFrames
- dev/stats/explore_pr_candidates.ipynb:cell 3:23:5: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/amazon/tests/unit/amazon/aws/transfers/test_sql_to_s3.py:232:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/amazon/tests/unit/amazon/aws/transfers/test_sql_to_s3.py:283:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/amazon/tests/unit/amazon/aws/transfers/test_sql_to_s3.py:326:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/apache/drill/tests/unit/apache/drill/hooks/test_drill.py:116:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/apache/drill/tests/unit/apache/drill/hooks/test_drill.py:99:9: PD901 Avoid using the generic variable name `df` for DataFrames
- providers/apache/druid/tests/unit/apache/druid/hooks/test_druid.py:461:9: PD901 Avoid using the generic variable name `df` for DataFrames
... 62 additional changes omitted for project

apache/superset (+0 -267 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview --select ALL

- superset/charts/client_processing.py:110:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:112:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:113:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:114:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:124:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:132:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:136:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:141:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:144:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:147:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:206:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:213:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:341:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:343:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:91:5: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/charts/client_processing.py:95:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/database/uploaders/csv_reader.py:135:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/database/uploaders/excel_reader.py:108:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/dataset/importers/v1/utils.py:207:5: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/report/alert.py:179:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/report/alert.py:204:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/sql_lab/export.py:104:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/commands/sql_lab/export.py:128:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_actions.py:104:5: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:268:9: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:275:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:279:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:287:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:602:13: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:658:17: PD901 Avoid using the generic variable name `df` for DataFrames
- superset/common/query_context_processor.py:665:17: PD901 Avoid using the generic variable name `df` for DataFrames
... 236 additional changes omitted for project

bokeh/bokeh (+0 -91 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --preview --select ALL

- examples/basic/annotations/band.py:21:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/annotations/band.py:25:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/annotations/polygon_annotation.py:12:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/areas/stacked_area.py:16:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/axes/datetime_axis.py:6:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/basic/bars/intervals.py:14:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/interaction/legends/legend_hide.py:22:5: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/interaction/legends/legend_mute.py:11:5: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/models/daylight.py:24:1: PD901 Avoid using the generic variable name `df` for DataFrames
- examples/models/trail.py:36:5: PD901 Avoid using the generic variable name `df` for DataFrames
... 81 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PD901 430 0 430 0 0

@ntBre ntBre force-pushed the brent/deprecate-pd901 branch from 298a7ac to 452db43 Compare June 10, 2025 20:47
@ntBre ntBre requested review from MichaReiser and removed request for AlexWaygood June 10, 2025 20:49
@ntBre ntBre force-pushed the brent/release-0.12.0 branch 2 times, most recently from 3ad0f1f to ff6fb14 Compare June 11, 2025 11:09
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I share your sentiment. I wouldn't add this rule to Ruff today but I also think it isn't harmful.

Either way, I think this is heading in the right direction and we could consider adding a new lint rule instead that allows users to configure a set of names that they want to disallow.

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
@ntBre ntBre force-pushed the brent/deprecate-pd901 branch from 452db43 to 739f4ba Compare June 12, 2025 14:15
@ntBre ntBre merged commit beb9667 into brent/release-0.12.0 Jun 12, 2025
34 checks passed
@ntBre ntBre deleted the brent/deprecate-pd901 branch June 12, 2025 14:26
ntBre added a commit that referenced this pull request Jun 12, 2025
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
ntBre added a commit that referenced this pull request Jun 16, 2025
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
ntBre added a commit that referenced this pull request Jun 17, 2025
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
ntBre added a commit that referenced this pull request Jun 17, 2025
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
carljm added a commit to MatthewMckee4/ruff that referenced this pull request Jun 17, 2025
…ence

* main: (71 commits)
  Bump 0.12.0 (astral-sh#18724)
  Revert "[ty] Offer "Did you mean...?" suggestions for unresolved `from` imports and unresolved attributes (astral-sh#18705)" (astral-sh#18721)
  [`flake8-return`] Stabilize only add `return None` at the end when fixing `implicit-return` (`RET503`) (astral-sh#18516)
  [`pyupgrade`] Stabilize `non-pep695-generic-function` (`UP047`) (astral-sh#18524)
  [`pyupgrade`] Stabilize `non-pep695-generic-class` (`UP046`) (astral-sh#18519)
  [`pandas-vet`] Deprecate `pandas-df-variable-name` (`PD901`) (astral-sh#18618)
  [`flake8-bandit`] Remove `suspicious-xmle-tree-usage` (`S320`) (astral-sh#18617)
  Stabilize `dataclass-enum` (`RUF049`) (astral-sh#18570)
  Stabilize `unnecessary-dict-index-lookup` (`PLR1733`) (astral-sh#18571)
  Remove rust-toolchain.toml from sdist (astral-sh#17925)
  Stabilize `starmap-zip` (`RUF058`) (astral-sh#18525)
  [`flake8-logging`] Stabilize `exc-info-outside-except-handler` (`LOG014`) (astral-sh#18517)
  [`pyupgrade`] Stabilize `non-pep604-annotation-optional` (`UP045`) and preview behavior for `non-pep604-annotation-union` (`UP007`) (astral-sh#18505)
  Stabilize `pytest-warns-too-broad` (`PT030`) (astral-sh#18568)
  Stabilize `for-loop-writes` (`FURB122`) (astral-sh#18565)
  Stabilize `pytest-warns-with-multiple-statements` (`PT031`) (astral-sh#18569)
  Stabilize `pytest-parameter-with-default-argument` (`PT028`) (astral-sh#18566)
  Stabilize `nan-comparison` (`PLW0177`) (astral-sh#18559)
  Stabilize `check-and-remove-from-set` (`FURB132`) (astral-sh#18560)
  Stabilize `unnecessary-round` (`RUF057`) (astral-sh#18563)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking API change rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants