ashb commented on a change in pull request #5118: [AIRFLOW-4315] Add monitoring 
API's to airflow
URL: https://github.com/apache/airflow/pull/5118#discussion_r280729997
 
 

 ##########
 File path: airflow/api/common/experimental/get_tasks.py
 ##########
 @@ -34,11 +33,5 @@ def get_dag_run_state(dag_id, execution_date):
     # Get DAG object and check Task Exists
     dag = dagbag.get_dag(dag_id)
 
-    # Get DagRun object and check that it exists
-    dagrun = dag.get_dagrun(execution_date=execution_date)
-    if not dagrun:
-        error_message = ('Dag Run for date {} not found in dag {}'
-                         .format(execution_date, dag_id))
-        raise DagRunNotFound(error_message)
-
-    return {'state': dagrun.get_state()}
+    # Return the task.
+    return dag.task_ids
 
 Review comment:
   The change as I proposed won't need any changes anywhere else. Try it? I 
don't why you'd need to touch the DagBag at all - `get_dag()` will return a DAG 
object or will thrown an exception

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to