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_r280353481
##########
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:
I mean that we remove this function, and where it is currently called in
your PR:
```python
task_list = list()
task_ids = get_tasks(dag_id)
```
change it to something like.
```python
task_ids = get_dag(dag_id).task_ids
```
----------------------------------------------------------------
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