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

[airflow] add autofix to AIR302 check_name #16965

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Lee-W
Copy link
Contributor

@Lee-W Lee-W commented Mar 25, 2025

Summary

Add autofix logic to "airflow", "api_connexion", "security", "requires_access_dataset", "airflow", "Dataset" and "airflow", "datasets", "Dataset"

Test Plan

The existing test fixture reflects the update

@Lee-W
Copy link
Contributor Author

Lee-W commented Mar 25, 2025

This is intentionally to be kept simple for easier review. I can update the rest nams in this or the following PR after we agree on how this should work. Thanks!

Copy link
Contributor

github-actions bot commented Mar 25, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

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

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

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

+ providers/common/io/src/airflow/providers/common/io/assets/file.py:36:59: AIR302 Use `airflow.sdk.Asset` instead
- providers/common/io/src/airflow/providers/common/io/assets/file.py:36:59: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/common/io/src/airflow/providers/common/io/assets/file.py:48:12: AIR302 Use `airflow.sdk.Asset` instead
- providers/common/io/src/airflow/providers/common/io/assets/file.py:48:12: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/common/io/src/airflow/providers/common/io/assets/file.py:57:41: AIR302 Use `airflow.sdk.Asset` instead
- providers/common/io/src/airflow/providers/common/io/assets/file.py:57:41: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/google/src/airflow/providers/google/assets/gcs.py:40:74: AIR302 Use `airflow.sdk.Asset` instead
- providers/google/src/airflow/providers/google/assets/gcs.py:40:74: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/google/src/airflow/providers/google/assets/gcs.py:41:12: AIR302 Use `airflow.sdk.Asset` instead
- providers/google/src/airflow/providers/google/assets/gcs.py:41:12: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/google/src/airflow/providers/google/assets/gcs.py:50:41: AIR302 Use `airflow.sdk.Asset` instead
- providers/google/src/airflow/providers/google/assets/gcs.py:50:41: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/openlineage/src/airflow/providers/openlineage/utils/utils.py:455:84: AIR302 Use `airflow.sdk.Asset` instead
- providers/openlineage/src/airflow/providers/openlineage/utils/utils.py:455:84: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/openlineage/src/airflow/providers/openlineage/utils/utils.py:456:86: AIR302 Use `airflow.sdk.Asset` instead
- providers/openlineage/src/airflow/providers/openlineage/utils/utils.py:456:86: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/openlineage/src/airflow/providers/openlineage/utils/utils.py:785:36: AIR302 Use `airflow.sdk.Asset` instead
- providers/openlineage/src/airflow/providers/openlineage/utils/utils.py:785:36: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/openlineage/src/airflow/providers/openlineage/utils/utils.py:820:36: AIR302 Use `airflow.sdk.Asset` instead
- providers/openlineage/src/airflow/providers/openlineage/utils/utils.py:820:36: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/standard/tests/unit/standard/decorators/test_python.py:983:17: AIR302 Use `airflow.sdk.Asset` instead
- providers/standard/tests/unit/standard/decorators/test_python.py:983:17: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/standard/tests/unit/standard/decorators/test_python.py:985:17: AIR302 Use `airflow.sdk.Asset` instead
- providers/standard/tests/unit/standard/decorators/test_python.py:985:17: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/standard/tests/unit/standard/decorators/test_python.py:993:22: AIR302 Use `airflow.sdk.Asset` instead
- providers/standard/tests/unit/standard/decorators/test_python.py:993:22: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0
+ providers/standard/tests/unit/standard/decorators/test_python.py:997:22: AIR302 Use `airflow.sdk.Asset` instead
- providers/standard/tests/unit/standard/decorators/test_python.py:997:22: AIR302 `airflow.datasets.Dataset` is removed in Airflow 3.0

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
AIR302 28 14 14 0 0

@Lee-W Lee-W mentioned this pull request Mar 26, 2025
11 tasks
@ntBre ntBre added the fixes Related to suggested fixes for violations label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants