You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2021/03/31 21:24:02 UTC
[airflow] branch master updated: Fixed all remaining code usage of
old task import (#15118)
This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new 0e024c4 Fixed all remaining code usage of old task import (#15118)
0e024c4 is described below
commit 0e024c4a79ed5843d7eb6d53fc5f6e4950d2f42a
Author: Andrew Godwin <an...@astronomer.io>
AuthorDate: Wed Mar 31 15:23:46 2021 -0600
Fixed all remaining code usage of old task import (#15118)
This finishes the job of removing all imports of task from
`operators.python` and replaces them with the new import from
`decorators`.
---
tests/models/test_dag.py | 2 +-
tests/models/test_dagparam.py | 2 +-
tests/utils/test_task_group.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/models/test_dag.py b/tests/models/test_dag.py
index d2d0f9a..7f00134 100644
--- a/tests/models/test_dag.py
+++ b/tests/models/test_dag.py
@@ -38,6 +38,7 @@ from parameterized import parameterized
from airflow import models, settings
from airflow.configuration import conf
+from airflow.decorators import task as task_decorator
from airflow.exceptions import AirflowException, DuplicateTaskIdFound
from airflow.models import DAG, DagModel, DagRun, DagTag, TaskFail, TaskInstance as TI
from airflow.models.baseoperator import BaseOperator
@@ -45,7 +46,6 @@ from airflow.models.dag import dag as dag_decorator
from airflow.models.dagparam import DagParam
from airflow.operators.bash import BashOperator
from airflow.operators.dummy import DummyOperator
-from airflow.operators.python import task as task_decorator
from airflow.operators.subdag import SubDagOperator
from airflow.security import permissions
from airflow.utils import timezone
diff --git a/tests/models/test_dagparam.py b/tests/models/test_dagparam.py
index 1eb28cb..618eb88 100644
--- a/tests/models/test_dagparam.py
+++ b/tests/models/test_dagparam.py
@@ -19,8 +19,8 @@
import unittest
from datetime import timedelta
+from airflow.decorators import task
from airflow.models.dag import DAG
-from airflow.operators.python import task
from airflow.utils import timezone
from airflow.utils.state import State
from airflow.utils.types import DagRunType
diff --git a/tests/utils/test_task_group.py b/tests/utils/test_task_group.py
index 0bc80e3..de227e4 100644
--- a/tests/utils/test_task_group.py
+++ b/tests/utils/test_task_group.py
@@ -269,7 +269,7 @@ def test_build_task_group_with_task_decorator():
"""
Test that TaskGroup can be used with the @task decorator.
"""
- from airflow.operators.python import task
+ from airflow.decorators import task
@task
def task_1():