From fdb4e30578decb7ebe088f3d4d1cb9871570cc13 Mon Sep 17 00:00:00 2001 From: Amogh Desai Date: Tue, 16 Sep 2025 19:50:48 +0530 Subject: [PATCH 1/4] Improve Airflow 3 import deprecation documentation --- .../installation/upgrading_to_airflow3.rst | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/airflow-core/docs/installation/upgrading_to_airflow3.rst b/airflow-core/docs/installation/upgrading_to_airflow3.rst index 115c336653526..49117a3d41285 100644 --- a/airflow-core/docs/installation/upgrading_to_airflow3.rst +++ b/airflow-core/docs/installation/upgrading_to_airflow3.rst @@ -122,6 +122,44 @@ To trigger these fixes, run the following command: You can also configure these flags through configuration files. See `Configuring Ruff `_ for details. +Key Import Updates +^^^^^^^^^^^^^^^^^^ + +While ruff can automatically fix many import issues, here are the key import changes you'll need to make to ensure your DAGs and other +code import Airflow components correctly in Airflow 3. The older paths are deprecated and will be removed in a future Airflow version. + +.. list-table:: + :header-rows: 1 + :widths: 50, 50 + + * - **Old Import Path (Deprecated)** + - **New Import Path (airflow.sdk)** + * - ``airflow.decorators.dag`` + - ``airflow.sdk.dag`` + * - ``airflow.decorators.task`` + - ``airflow.sdk.task`` + * - ``airflow.decorators.task_group`` + - ``airflow.sdk.task_group`` + * - ``airflow.decorators.setup`` + - ``airflow.sdk.setup`` + * - ``airflow.decorators.teardown`` + - ``airflow.sdk.teardown`` + * - ``airflow.models.baseoperator.BaseOperator`` + - ``airflow.sdk.BaseOperator`` + * - ``airflow.sensors.base.BaseSensorOperator`` + - ``airflow.sdk.BaseSensorOperator`` + * - ``airflow.hooks.base.BaseHook`` + - ``airflow.sdk.BaseHook`` + * - ``airflow.utils.task_group.TaskGroup`` + - ``airflow.sdk.TaskGroup`` + * - ``airflow.io.*`` + - ``airflow.sdk.io.*`` + +**Migration Timeline** + +- **Airflow 3.1**: Legacy imports show deprecation warnings but continue to work +- **Future Airflow version**: Legacy imports will be **removed** + Step 4: Install the Standard Provider -------------------------------------- From 092ec158b2a9f2ada72c9ab73b65e5bedc1a6768 Mon Sep 17 00:00:00 2001 From: Amogh Desai Date: Tue, 16 Sep 2025 20:02:30 +0530 Subject: [PATCH 2/4] Improve Airflow 3 import deprecation documentation --- .../docs/installation/upgrading_to_airflow3.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/airflow-core/docs/installation/upgrading_to_airflow3.rst b/airflow-core/docs/installation/upgrading_to_airflow3.rst index 49117a3d41285..ce6d0b102e94f 100644 --- a/airflow-core/docs/installation/upgrading_to_airflow3.rst +++ b/airflow-core/docs/installation/upgrading_to_airflow3.rst @@ -144,12 +144,22 @@ code import Airflow components correctly in Airflow 3. The older paths are depre - ``airflow.sdk.setup`` * - ``airflow.decorators.teardown`` - ``airflow.sdk.teardown`` + * - ``airflow.models.dag.DAG`` + - ``airflow.sdk.DAG`` * - ``airflow.models.baseoperator.BaseOperator`` - ``airflow.sdk.BaseOperator`` + * - ``airflow.models.param.Param`` + - ``airflow.sdk.Param`` + * - ``airflow.models.param.ParamsDict`` + - ``airflow.sdk.ParamsDict`` + * - ``airflow.models.baseoperatorlink.BaseOperatorLink`` + - ``airflow.sdk.BaseOperatorLink`` * - ``airflow.sensors.base.BaseSensorOperator`` - ``airflow.sdk.BaseSensorOperator`` * - ``airflow.hooks.base.BaseHook`` - ``airflow.sdk.BaseHook`` + * - ``airflow.notifications.basenotifier.BaseNotifier`` + - ``airflow.sdk.BaseNotifier`` * - ``airflow.utils.task_group.TaskGroup`` - ``airflow.sdk.TaskGroup`` * - ``airflow.io.*`` From 33424f445f293a5906a30f30647ce3f81e23cf28 Mon Sep 17 00:00:00 2001 From: Amogh Desai Date: Tue, 16 Sep 2025 20:26:02 +0530 Subject: [PATCH 3/4] Improve Airflow 3 import deprecation documentation --- airflow-core/docs/installation/upgrading_to_airflow3.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/airflow-core/docs/installation/upgrading_to_airflow3.rst b/airflow-core/docs/installation/upgrading_to_airflow3.rst index ce6d0b102e94f..db287e3bb2d3d 100644 --- a/airflow-core/docs/installation/upgrading_to_airflow3.rst +++ b/airflow-core/docs/installation/upgrading_to_airflow3.rst @@ -162,6 +162,14 @@ code import Airflow components correctly in Airflow 3. The older paths are depre - ``airflow.sdk.BaseNotifier`` * - ``airflow.utils.task_group.TaskGroup`` - ``airflow.sdk.TaskGroup`` + * - ``airflow.datasets.Dataset`` + - ``airflow.sdk.Asset`` + * - ``airflow.models.connection.Connection`` + - ``airflow.sdk.Connection`` + * - ``airflow.models.context.Context`` + - ``airflow.sdk.Context`` + * - ``airflow.models.variable.Variable`` + - ``airflow.sdk.Variable`` * - ``airflow.io.*`` - ``airflow.sdk.io.*`` From 207957520a956efc6d355cfd3da08eacc1226230 Mon Sep 17 00:00:00 2001 From: Amogh Desai Date: Tue, 16 Sep 2025 20:31:44 +0530 Subject: [PATCH 4/4] Improve Airflow 3 import deprecation documentation --- airflow-core/docs/installation/upgrading_to_airflow3.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/airflow-core/docs/installation/upgrading_to_airflow3.rst b/airflow-core/docs/installation/upgrading_to_airflow3.rst index db287e3bb2d3d..ecd7090fd0721 100644 --- a/airflow-core/docs/installation/upgrading_to_airflow3.rst +++ b/airflow-core/docs/installation/upgrading_to_airflow3.rst @@ -164,6 +164,12 @@ code import Airflow components correctly in Airflow 3. The older paths are depre - ``airflow.sdk.TaskGroup`` * - ``airflow.datasets.Dataset`` - ``airflow.sdk.Asset`` + * - ``airflow.datasets.DatasetAlias`` + - ``airflow.sdk.AssetAlias`` + * - ``airflow.datasets.DatasetAll`` + - ``airflow.sdk.AssetAll`` + * - ``airflow.datasets.DatasetAny`` + - ``airflow.sdk.AssetAny`` * - ``airflow.models.connection.Connection`` - ``airflow.sdk.Connection`` * - ``airflow.models.context.Context``