Skip to content

Conversation

@Lee-W
Copy link
Contributor

@Lee-W Lee-W commented Oct 27, 2025

Summary

  • Warn that airflow....DAG.create_dagrun has been removed

Test Plan

update accordingly and reorganize test cases

@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2025

ruff-ecosystem results

Linter (stable)

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

apache/airflow (+227 -0 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/cli/commands/dag_command.py:240:34: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:388:32: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:403:29: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:413:46: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:413:96: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:547:30: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:578:34: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:616:25: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/dag_processing/dagbag.py:155:36: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/dag_processing/dagbag.py:245:30: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/dag_processing/dagbag.py:561:28: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/integration/otel/dags/otel_test_dag.py:87:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/integration/otel/dags/otel_test_dag_with_pause_between_tasks.py:152:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/integration/otel/dags/otel_test_dag_with_pause_in_task.py:145:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/unit/dag_processing/test_processor.py:541:11: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/unit/utils/test_db_cleanup.py:684:15: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ devel-common/src/tests_common/pytest_plugin.py:1251:24: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ devel-common/src/tests_common/pytest_plugin.py:2805:16: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ performance/src/performance_dags/performance_dag/performance_dag.py:235:11: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/airbyte/tests/system/airbyte/example_airbyte_trigger_job.py:33:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/amazon/tests/unit/amazon/aws/operators/test_s3.py:651:15: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/amazon/tests/unit/amazon/aws/transfers/test_base.py:42:20: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/amazon/tests/unit/amazon/aws/transfers/test_dynamodb_to_s3.py:268:15: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/apache/druid/tests/system/apache/druid/example_druid.py:31:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/apache/flink/tests/unit/apache/flink/operators/test_flink_kubernetes.py:201:20: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/apache/flink/tests/unit/apache/flink/sensors/test_flink_kubernetes.py:887:20: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
... 199 additional changes omitted for rule AIR311
+ providers/openlineage/tests/unit/openlineage/plugins/test_listener.py:123:13: AIR301 `create_dagrun` is removed in Airflow 3.0
+ providers/openlineage/tests/unit/openlineage/plugins/test_listener.py:966:13: AIR301 `create_dagrun` is removed in Airflow 3.0
+ providers/openlineage/tests/unit/openlineage/utils/test_utils.py:1715:18: AIR301 `create_dagrun` is removed in Airflow 3.0
... 198 additional changes omitted for project

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
AIR311 224 224 0 0 0
AIR301 3 3 0 0 0

Linter (preview)

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

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

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

+ airflow-core/src/airflow/cli/commands/dag_command.py:240:34: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:388:32: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:403:29: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:413:46: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:413:96: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:547:30: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:578:34: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/cli/commands/dag_command.py:616:25: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/dag_processing/dagbag.py:155:36: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/dag_processing/dagbag.py:245:30: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/src/airflow/dag_processing/dagbag.py:561:28: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/integration/otel/dags/otel_test_dag.py:87:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/integration/otel/dags/otel_test_dag_with_pause_between_tasks.py:152:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/integration/otel/dags/otel_test_dag_with_pause_in_task.py:145:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/unit/dag_processing/test_processor.py:541:11: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ airflow-core/tests/unit/utils/test_db_cleanup.py:684:15: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ devel-common/src/tests_common/pytest_plugin.py:1251:24: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ devel-common/src/tests_common/pytest_plugin.py:2805:16: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ performance/src/performance_dags/performance_dag/performance_dag.py:235:11: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/airbyte/tests/system/airbyte/example_airbyte_trigger_job.py:33:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/amazon/tests/unit/amazon/aws/operators/test_s3.py:651:15: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/amazon/tests/unit/amazon/aws/transfers/test_base.py:42:20: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/amazon/tests/unit/amazon/aws/transfers/test_dynamodb_to_s3.py:268:15: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/apache/druid/tests/system/apache/druid/example_druid.py:31:6: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/apache/flink/tests/unit/apache/flink/operators/test_flink_kubernetes.py:201:20: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
+ providers/apache/flink/tests/unit/apache/flink/sensors/test_flink_kubernetes.py:887:20: AIR311 `airflow.DAG` is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version.
... 199 additional changes omitted for rule AIR311
+ providers/openlineage/tests/unit/openlineage/plugins/test_listener.py:123:13: AIR301 `create_dagrun` is removed in Airflow 3.0
+ providers/openlineage/tests/unit/openlineage/plugins/test_listener.py:966:13: AIR301 `create_dagrun` is removed in Airflow 3.0
+ providers/openlineage/tests/unit/openlineage/utils/test_utils.py:1715:18: AIR301 `create_dagrun` is removed in Airflow 3.0
... 198 additional changes omitted for project

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
AIR311 224 224 0 0 0
AIR301 3 3 0 0 0

@Lee-W Lee-W changed the title feat(AIR301): warn that . has been removed [airflow] warning airflow....DAG.create_dagrun has been removed Oct 27, 2025
@Lee-W Lee-W changed the title [airflow] warning airflow....DAG.create_dagrun has been removed [airflow] warning airflow....DAG.create_dagrun has been removed (AIR301) Oct 27, 2025
@MichaReiser
Copy link
Member

Now that the rule is stable, changes like this may need to be gated behind preview and go through our normal stabilization period.

I think the change here is fine as it isn't a significant expansion of the rule's scope:

@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Oct 27, 2025
"collected_datasets" => Replacement::AttrName("collected_assets"),
_ => return,
},
["airflow", .., "DAG"] => match attr.as_str() {
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to be explicit from which module DAG was removed to avoid false positives instead of allowing any DAG symbol imported from anywhere within airflow (e.g. this also flags airflow.providers.my_provider.DAG)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's unlikely, but definiely better. Let me make the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just updated. Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Can you double-check if you pushed your most recent changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, sorry for the mess, it might be missed due to wrong rebasing. Just updated it and checked again. Thanks for reminder!

@Lee-W
Copy link
Contributor Author

Lee-W commented Oct 27, 2025

Now that the rule is stable, changes like this may need to be gated behind preview and go through our normal stabilization period.

I think the change here is fine as it isn't a significant expansion of the rule's scope:

We had a discussion with @ntBre previously. Our conclusion back then was this kind of small ones are fine.

But if we want to make it gated behind preview, what would be the process? Do we need to extract these logic to somewhere so that they can be activated through preview flag? Thanks!

@ntBre
Copy link
Contributor

ntBre commented Oct 27, 2025

But if we want to make it gated behind preview, what would be the process? Do we need to extract these logic to somewhere so that they can be activated through preview flag? Thanks!

It should be pretty easy to add guards to the match arms and a new preview function like in preview.rs.

But I agree that this change seems fine without preview.

@Lee-W
Copy link
Contributor Author

Lee-W commented Oct 27, 2025

Cool! This is super helpful! We might have some minor ones like this. Please let me know if any of them need to be in preview mode. Thank you!

@Lee-W Lee-W force-pushed the extend-AIR301-create-dagrun branch from ed4bde9 to 7e08683 Compare October 29, 2025 01:09
@MichaReiser MichaReiser merged commit d38a529 into astral-sh:main Oct 29, 2025
37 checks passed
dcreager added a commit that referenced this pull request Oct 30, 2025
* origin/main: (21 commits)
  [ty] Update "constraint implication" relation to work on constraints between two typevars (#21068)
  [`flake8-type-checking`] Fix `TC003` false positive with `future-annotations` (#21125)
  [ty] Fix lookup of `__new__` on instances (#21147)
  Fix syntax error false positive on nested alternative patterns (#21104)
  [`pyupgrade`] Fix false positive for `TypeVar` with default on Python <3.13 (`UP046`,`UP047`) (#21045)
  [ty] Reachability and narrowing for enum methods (#21130)
  [ty] Use `range` instead of custom `IntIterable` (#21138)
  [`ruff`] Add support for additional eager conversion patterns (`RUF065`) (#20657)
  [`ruff-ecosystem`] Fix CLI crash on Python 3.14 (#21092)
  [ty] Infer type of `self` for decorated methods and properties (#21123)
  [`flake8-bandit`] Fix correct example for `S308` (#21128)
  [ty] Dont provide goto definition for definitions which are not reexported in builtins (#21127)
  [`airflow`] warning `airflow....DAG.create_dagrun` has been removed (`AIR301`) (#21093)
  [ty] follow the breaking API changes made in salsa-rs/salsa#1015 (#21117)
  [ty] Rename `Type::into_nominal_instance` (#21124)
  [ty] Filter out "unimported" from the current module
  [ty] Add evaluation test for auto-import including symbols in current module
  [ty] Refactor `ty_ide` completion tests
  [ty] Render `import <...>` in completions when "label details" isn't supported
  [`refurb`] Preserve digit separators in `Decimal` constructor (`FURB157`) (#20588)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants