Skip to content

Commit 6ef3c93

Browse files
committed
import tasktimeout properly
1 parent 91d85be commit 6ef3c93

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

airflow-core/src/airflow/dag_processing/dagbag.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
AirflowClusterPolicyViolation,
4444
AirflowDagDuplicatedIdException,
4545
AirflowException,
46-
AirflowTaskTimeout,
4746
UnknownExecutorException,
4847
)
4948
from airflow.executors.executor_loader import ExecutorLoader
@@ -119,6 +118,8 @@ def timeout(seconds=1, error_message="Timeout"):
119118
def handle_timeout(signum, frame):
120119
"""Log information and raises AirflowTaskTimeout."""
121120
log.error("Process timed out, PID: %s", str(os.getpid()))
121+
from airflow.sdk.exceptions import AirflowTaskTimeout
122+
122123
raise AirflowTaskTimeout(error_message)
123124

124125
try:

task-sdk/tests/task_sdk/execution_time/test_task_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
from airflow.sdk.definitions.asset import Asset, AssetAlias, AssetUniqueKey, Dataset, Model
6262
from airflow.sdk.definitions.param import DagParam
6363
from airflow.sdk.exceptions import (
64+
AirflowException,
6465
AirflowFailException,
6566
AirflowSensorTimeout,
6667
AirflowSkipException,

0 commit comments

Comments
 (0)