Skip to content

Commit 91aad8c

Browse files
committed
fix: Attempt to use dag.test() for Airflow 3.0 too
1 parent 0eba6d5 commit 91aad8c

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

tests/dags/test_dbt_dags.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,9 @@ def _create_dagrun(
6666
start_date: dt.datetime,
6767
run_type: DagRunType,
6868
) -> DagRun:
69-
if AIRFLOW_V_3_1_PLUS:
69+
if AIRFLOW_V_3_0_PLUS:
7070
return parent_dag.test()
7171

72-
elif AIRFLOW_V_3_0_PLUS:
73-
from airflow.utils.types import DagRunTriggeredByType # type: ignore
74-
75-
return parent_dag.create_dagrun( # type: ignore
76-
run_id=f"{parent_dag.dag_id}-{logical_date.isoformat()}-RUN",
77-
state=state,
78-
logical_date=logical_date,
79-
data_interval=data_interval,
80-
start_date=start_date,
81-
conf={},
82-
backfill_id=None,
83-
creating_job_id=None,
84-
run_type=run_type,
85-
run_after=dt.datetime(1970, 1, 1, 0, 0, 0, tzinfo=dt.timezone.utc),
86-
triggered_by=DagRunTriggeredByType.TIMETABLE,
87-
)
8872
else:
8973
return parent_dag.create_dagrun( # type: ignore
9074
state=state,

0 commit comments

Comments
 (0)