astahlman commented on a change in pull request #4396: [AIRFLOW-3585] - Add 
edges to database
URL: https://github.com/apache/airflow/pull/4396#discussion_r257091744
 
 

 ##########
 File path: airflow/www/views.py
 ##########
 @@ -920,10 +924,16 @@ def clear(self):
         dag_id = request.args.get('dag_id')
         task_id = request.args.get('task_id')
         origin = request.args.get('origin')
-        dag = dagbag.get_dag(dag_id)
+        orm_dag = models.DagModel.get_dagmodel(dag_id)
+        if not orm_dag:
+            flash("Dag '{}' does not exist".format(dag_id), 'error')
+            return redirect(origin)
+        dag = orm_dag.get_dag()
+        if task_id not in dag.task_dict:
+            flash("Task '{}' does not exist in '{}' anymore".format(task_id, 
orm_dag.fileloc), 'error')
 
 Review comment:
   Any reason to show the DAG's fileloc instead of the DAG's id? (The latter 
seems more natural, to me)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to