File tree Expand file tree Collapse file tree 3 files changed +13
-14
lines changed
src/airflow/providers/standard/operators
tests/unit/standard/operators Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -246,17 +246,6 @@ class AirflowTimetableInvalid(AirflowException):
246
246
"""Raise when a DAG has an invalid timetable."""
247
247
248
248
249
- class DagIsPaused (AirflowException ):
250
- """Raise when a dag is paused and something tries to run it."""
251
-
252
- def __init__ (self , dag_id : str ) -> None :
253
- super ().__init__ (dag_id )
254
- self .dag_id = dag_id
255
-
256
- def __str__ (self ) -> str :
257
- return f"Dag { self .dag_id } is paused"
258
-
259
-
260
249
class DagNotFound (AirflowNotFoundException ):
261
250
"""Raise when a DAG is not available in the system."""
262
251
Original file line number Diff line number Diff line change 60
60
from airflow .utils .context import Context
61
61
62
62
if AIRFLOW_V_3_0_PLUS :
63
- from airflow .exceptions import DagIsPaused
64
63
from airflow .sdk import BaseOperatorLink
65
64
from airflow .sdk .execution_time .xcom import XCom
66
65
else :
67
66
from airflow .models import XCom # type: ignore[no-redef]
68
67
from airflow .models .baseoperatorlink import BaseOperatorLink # type: ignore[no-redef]
69
68
70
69
70
+ class DagIsPaused (AirflowException ):
71
+ """Raise when a dag is paused and something tries to run it."""
72
+
73
+ def __init__ (self , dag_id : str ) -> None :
74
+ super ().__init__ (dag_id )
75
+ self .dag_id = dag_id
76
+
77
+ def __str__ (self ) -> str :
78
+ return f"Dag { self .dag_id } is paused"
79
+
80
+
71
81
class TriggerDagRunLink (BaseOperatorLink ):
72
82
"""
73
83
Operator link for TriggerDagRunOperator.
Original file line number Diff line number Diff line change 30
30
from airflow .models .dagrun import DagRun
31
31
from airflow .models .log import Log
32
32
from airflow .models .taskinstance import TaskInstance
33
- from airflow .providers .standard .operators .trigger_dagrun import TriggerDagRunOperator
33
+ from airflow .providers .standard .operators .trigger_dagrun import DagIsPaused , TriggerDagRunOperator
34
34
from airflow .providers .standard .triggers .external_task import DagStateTrigger
35
35
from airflow .utils import timezone
36
36
from airflow .utils .session import create_session
41
41
from tests_common .test_utils .version_compat import AIRFLOW_V_3_0_PLUS
42
42
43
43
if AIRFLOW_V_3_0_PLUS :
44
- from airflow .exceptions import DagIsPaused , DagRunTriggerException
44
+ from airflow .exceptions import DagRunTriggerException
45
45
46
46
pytestmark = pytest .mark .db_test
47
47
You can’t perform that action at this time.
0 commit comments