Skip to content

Commit

Permalink
34058: Fix UI Grid error when DAG has been removed. (apache#36028)
Browse files Browse the repository at this point in the history
  • Loading branch information
avkirilishin authored Dec 3, 2023
1 parent fd09883 commit 549fac3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3013,6 +3013,9 @@ def legacy_graph(self):
def graph(self, dag_id: str, session: Session = NEW_SESSION):
"""Redirect to the replacement - grid + graph. Kept for backwards compatibility."""
dag = get_airflow_app().dag_bag.get_dag(dag_id, session=session)
if not dag:
flash(f'DAG "{dag_id}" seems to be missing from DagBag.', "error")
return redirect(url_for("Airflow.index"))
dt_nr_dr_data = get_date_time_num_runs_dag_runs_form_data(request, session, dag)
dttm = dt_nr_dr_data["dttm"]
dag_run = dag.get_dagrun(execution_date=dttm)
Expand Down

0 comments on commit 549fac3

Please sign in to comment.