This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit d26510099537b7f2f99eae32ef1fc5f41dc195e0
Author: Aleksey Kirilishin <[email protected]>
AuthorDate: Sun Dec 3 05:11:15 2023 +0400

    34058: Fix UI Grid error when DAG has been removed. (#36028)
    
    (cherry picked from commit 549fac30eeefaa449df9bfdf58eb40a008e9fe75)
---
 airflow/www/views.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/airflow/www/views.py b/airflow/www/views.py
index c4230c1900..f51fbb9e79 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -3013,6 +3013,9 @@ class Airflow(AirflowBaseView):
     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)

Reply via email to