Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41667c1

Browse files
amoghrajeshsuii2210
authored andcommitted
Define TaskInstanceKey in task-sdk to support client server separation (apache#60776)
1 parent 6ed3064 commit 41667c1

31 files changed

Lines changed: 88 additions & 44 deletions

File tree

providers/alibaba/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ requires-python = ">=3.10"
5959
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
6060
dependencies = [
6161
"apache-airflow>=2.11.0",
62-
"apache-airflow-providers-common-compat>=1.12.0",
62+
"apache-airflow-providers-common-compat>=1.12.0", # use next version
6363
"oss2>=2.14.0",
6464
"alibabacloud_adb20211201>=1.0.0",
6565
"alibabacloud_tea_openapi>=0.3.7",

providers/alibaba/src/airflow/providers/alibaba/cloud/links/maxcompute.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
from airflow.providers.common.compat.sdk import BaseOperatorLink, XCom
2222

2323
if TYPE_CHECKING:
24-
from airflow.models.taskinstancekey import TaskInstanceKey
25-
from airflow.providers.common.compat.sdk import BaseOperator
24+
from airflow.providers.common.compat.sdk import BaseOperator, TaskInstanceKey
2625
from airflow.sdk import Context
2726

2827

providers/amazon/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ requires-python = ">=3.10"
5959
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
6060
dependencies = [
6161
"apache-airflow>=2.11.0",
62-
"apache-airflow-providers-common-compat>=1.12.0",
62+
"apache-airflow-providers-common-compat>=1.12.0", # use next version
6363
"apache-airflow-providers-common-sql>=1.27.0",
6464
"apache-airflow-providers-http",
6565
# We should update minimum version of boto3 and here regularly to avoid `pip` backtracking with the number

providers/amazon/src/airflow/providers/amazon/aws/links/base_aws.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
if TYPE_CHECKING:
2626
from airflow.models import BaseOperator
27-
from airflow.models.taskinstancekey import TaskInstanceKey
27+
from airflow.providers.common.compat.sdk import TaskInstanceKey
2828
from airflow.sdk import Context
2929

3030

providers/celery/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ requires-python = ">=3.10"
5959
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
6060
dependencies = [
6161
"apache-airflow>=2.11.0",
62-
"apache-airflow-providers-common-compat>=1.12.0",
62+
"apache-airflow-providers-common-compat>=1.12.0", # use next version
6363
# The Celery is known to introduce problems when upgraded to a MAJOR version. Airflow Core
6464
# Uses Celery for CeleryExecutor, and we also know that Kubernetes Python client follows SemVer
6565
# (https://docs.celeryq.dev/en/stable/contributing.html?highlight=semver#versions).

providers/celery/tests/integration/celery/test_celery_executor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
from airflow.executors import workloads
4444
from airflow.models.dag import DAG
4545
from airflow.models.taskinstance import TaskInstance
46-
from airflow.models.taskinstancekey import TaskInstanceKey
47-
from airflow.providers.common.compat.sdk import AirflowException, AirflowTaskTimeout
46+
from airflow.providers.common.compat.sdk import AirflowException, AirflowTaskTimeout, TaskInstanceKey
4847
from airflow.providers.standard.operators.bash import BashOperator
4948
from airflow.utils.state import State
5049

providers/cncf/kubernetes/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ requires-python = ">=3.10"
6060
dependencies = [
6161
"aiofiles>=23.2.0",
6262
"apache-airflow>=2.11.0",
63-
"apache-airflow-providers-common-compat>=1.10.1",
63+
"apache-airflow-providers-common-compat>=1.10.1", # use next version
6464
"asgiref>=3.5.2",
6565
# TODO(potiuk): We should bump cryptography to >=46.0.0 when sqlalchemy>=2.0 is required
6666
"cryptography>=41.0.0,<46.0.0",

providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/kubernetes_helper_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ def annotations_to_key(annotations: dict[str, str]) -> TaskInstanceKey:
166166

167167
# Compat: Look up the run_id from the TI table!
168168
from airflow.models.dagrun import DagRun
169-
from airflow.models.taskinstance import TaskInstance, TaskInstanceKey
169+
from airflow.models.taskinstance import TaskInstance
170+
from airflow.models.taskinstancekey import TaskInstanceKey
170171
from airflow.settings import Session
171172

172173
logical_date_key = get_logical_date_key()

providers/common/compat/src/airflow/providers/common/compat/sdk.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
)
112112
from airflow.sdk.execution_time.timeout import timeout as timeout
113113
from airflow.sdk.execution_time.xcom import XCom as XCom
114+
from airflow.sdk.types import TaskInstanceKey as TaskInstanceKey
114115

115116

116117
from airflow.providers.common.compat._compat_utils import create_module_getattr
@@ -185,6 +186,7 @@
185186
# Operator Links & Task Groups
186187
# ============================================================================
187188
"BaseOperatorLink": ("airflow.sdk", "airflow.models.baseoperatorlink"),
189+
"TaskInstanceKey": ("airflow.sdk.types", "airflow.models.taskinstancekey"),
188190
"TaskGroup": ("airflow.sdk", "airflow.utils.task_group"),
189191
# ============================================================================
190192
# Operator Utilities (chain, cross_downstream, etc.)

providers/databricks/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ requires-python = ">=3.10"
5959
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
6060
dependencies = [
6161
"apache-airflow>=2.11.0",
62-
"apache-airflow-providers-common-compat>=1.12.0",
62+
"apache-airflow-providers-common-compat>=1.12.0", # use next version
6363
"apache-airflow-providers-common-sql>=1.27.0",
6464
"requests>=2.32.0,<3",
6565
"databricks-sql-connector>=4.0.0",

0 commit comments

Comments
 (0)