ashb commented on a change in pull request #6684: [AIRFLOW-6095] Filter dags
returned by task_stats
URL: https://github.com/apache/airflow/pull/6684#discussion_r352555841
##########
File path: airflow/www/views.py
##########
@@ -347,47 +356,48 @@ def task_stats(self, session=None):
)
.join(Dag, Dag.dag_id == DagRun.dag_id)
.filter(DagRun.state != State.RUNNING, Dag.is_active)
+ .filter(DagRun.dag_id.in_(filter_dag_ids) if selected_dag_ids else
True)
Review comment:
Instead of `else True`
we should do something like:
```python
if selected_dag_ids:
LastDagRun = LastDagRun.filter(DagRun.dag_id.in_(filter_dag_ids))`
```
similar for RunningDagRun.
----------------------------------------------------------------
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