Skip to content

Commit 549fac3

Browse files
authored
34058: Fix UI Grid error when DAG has been removed. (#36028)
1 parent fd09883 commit 549fac3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

airflow/www/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,6 +3013,9 @@ def legacy_graph(self):
30133013
def graph(self, dag_id: str, session: Session = NEW_SESSION):
30143014
"""Redirect to the replacement - grid + graph. Kept for backwards compatibility."""
30153015
dag = get_airflow_app().dag_bag.get_dag(dag_id, session=session)
3016+
if not dag:
3017+
flash(f'DAG "{dag_id}" seems to be missing from DagBag.', "error")
3018+
return redirect(url_for("Airflow.index"))
30163019
dt_nr_dr_data = get_date_time_num_runs_dag_runs_form_data(request, session, dag)
30173020
dttm = dt_nr_dr_data["dttm"]
30183021
dag_run = dag.get_dagrun(execution_date=dttm)

0 commit comments

Comments
 (0)