jason810496 commented on code in PR #52177:
URL: https://github.com/apache/airflow/pull/52177#discussion_r2173789701
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py:
##########
@@ -122,9 +121,20 @@ def clear_dag_run(
"message": f"DAG with dag_id: '{dag_id}' has import errors and
cannot be triggered",
},
)
+ from airflow.jobs.scheduler_job_runner import SchedulerDagBag
+
+ dag_run = session.scalar(select(DagRun).where(DagRun.dag_id == dag_id,
DagRun.run_id == run_id))
+ dag_bag = SchedulerDagBag()
Review Comment:
Then we can get the same `SchedulerDagBag` instance via `SchedulerDagBagDep`
Depends for all routes that need `dag_bag`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]