Skip to content

Conversation

@Lee-W
Copy link
Contributor

@Lee-W Lee-W commented Apr 8, 2025

Summary

  • Simplify match conditions in AIR301
  • Fix
    • airflow.datasets.manager.DatasetManagerairflow.assets.manager.AssetManager
    • airflow.www.auth.has_access_datasetairflow.www.auth.has_access_dataset

Test Plan

The test fixture has been updated accordingly

@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -19 violations, +0 -0 fixes in 1 projects; 54 projects unchanged)

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

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

- providers/amazon/src/airflow/providers/amazon/aws/links/base_aws.py:41:19: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/databricks/src/airflow/providers/databricks/operators/databricks.py:251:28: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/databricks/src/airflow/providers/databricks/plugins/databricks_workflow.py:238:26: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/databricks/src/airflow/providers/databricks/plugins/databricks_workflow.py:272:38: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/databricks/src/airflow/providers/databricks/plugins/databricks_workflow.py:366:39: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/dbt/cloud/src/airflow/providers/dbt/cloud/operators/dbt.py:50:34: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/google/src/airflow/providers/google/cloud/links/base.py:38:22: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/google/src/airflow/providers/google/cloud/links/datafusion.py:44:22: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/google/src/airflow/providers/google/cloud/links/dataproc.py:136:24: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/google/src/airflow/providers/google/cloud/links/dataproc.py:83:20: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/google/src/airflow/providers/google/cloud/operators/dataproc_metastore.py:112:37: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/google/src/airflow/providers/google/cloud/operators/dataproc_metastore.py:64:29: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/google/src/airflow/providers/google/marketing_platform/links/analytics_admin.py:39:31: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/data_factory.py:52:53: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/powerbi.py:42:19: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/synapse.py:133:35: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py:71:25: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/standard/src/airflow/providers/standard/sensors/external_task.py:63:23: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0
- providers/yandex/src/airflow/providers/yandex/links/yq.py:43:14: AIR301 `airflow.models.baseoperatorlink.BaseOperatorLink` is removed in Airflow 3.0

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
AIR301 19 0 19 0 0

@Lee-W Lee-W force-pushed the refactor-AIR301 branch from e1ef051 to cf090cf Compare April 8, 2025 13:17
@Lee-W Lee-W changed the title Refactor air301 [Airflow] Refactor AIR301 logic and fix typos (AIR301) Apr 8, 2025
@Lee-W Lee-W marked this pull request as ready for review April 8, 2025 13:20
@Lee-W
Copy link
Contributor Author

Lee-W commented Apr 8, 2025

The TODOs are intentionally kept. They're things I think might be outdated but I'll need to confirm with the airflow community. Also, I would like to keep this PR simple

@Lee-W Lee-W mentioned this pull request Apr 8, 2025
2 tasks
@ntBre ntBre self-assigned this Apr 8, 2025
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Thanks! A couple of questions, but this looks good otherwise.

@Lee-W Lee-W force-pushed the refactor-AIR301 branch from b43779f to 90af759 Compare April 9, 2025 10:47
@ntBre
Copy link
Contributor

ntBre commented Apr 9, 2025

Is this ready to merge?

@Lee-W
Copy link
Contributor Author

Lee-W commented Apr 9, 2025

Is this ready to merge?

Yep, this is ready 🙂

@ntBre ntBre changed the title [Airflow] Refactor AIR301 logic and fix typos (AIR301) [airflow] Refactor AIR301 logic and fix typos (AIR301) Apr 9, 2025
@ntBre ntBre added documentation Improvements or additions to documentation preview Related to preview mode features internal An internal refactor or improvement and removed documentation Improvements or additions to documentation preview Related to preview mode features labels Apr 9, 2025
@ntBre ntBre merged commit 7c81408 into astral-sh:main Apr 9, 2025
22 checks passed
dcreager added a commit that referenced this pull request Apr 9, 2025
* main:
  [red-knot] Allow explicit specialization of generic classes (#17023)
  [`airflow`] Refactor `AIR301` logic and fix typos (`AIR301`) (#17293)
  [`airflow`] Extract `AIR312` from `AIR302` rules (`AIR302`, `AIR312`) (#17152)
  [red-knot] Improve handling of visibility constraints in external modules when resolving `*` imports (#17286)
  [red-knot] Add more tests for `*` imports (#17315)
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request Apr 9, 2025
…sh#17293)

<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

* Simplify match conditions in AIR301
* Fix
* `airflow.datasets.manager.DatasetManager` →
`airflow.assets.manager.AssetManager`
* `airflow.www.auth.has_access_dataset` →
`airflow.www.auth.has_access_dataset`

## Test Plan

<!-- How was it tested? -->
The test fixture has been updated accordingly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants