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_r352555071
##########
File path: airflow/www/views.py
##########
@@ -334,11 +334,20 @@ def task_stats(self, session=None):
DagRun = models.DagRun
Dag = models.DagModel
- filter_dag_ids = appbuilder.sm.get_accessible_dag_ids()
+ allowed_dag_ids = set(appbuilder.sm.get_accessible_dag_ids())
- payload = {}
- if not filter_dag_ids:
- return
+ if not allowed_dag_ids:
+ return Response('Forbidden', 403)
Review comment:
Not sure this should be a 403 -- what happens when there are no DAGs in an
install (or you don't have permission to any)? Would it make more sense to just
return an empty payload instead?
----------------------------------------------------------------
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