ffinfo commented on a change in pull request #4368: [AIRFLOW-3561] Improve 
queries
URL: https://github.com/apache/incubator-airflow/pull/4368#discussion_r243978038
 
 

 ##########
 File path: airflow/www/views.py
 ##########
 @@ -550,31 +550,29 @@ def chart(self):
     @login_required
     @provide_session
     def dag_stats(self, session=None):
-        ds = models.DagStat
+        dr = models.DagRun
+        dm = models.DagModel
+        dag_ids = session.query(dm.dag_id)
 
-        ds.update(
-            dag_ids=[dag.dag_id for dag in dagbag.dags.values() if not 
dag.is_subdag]
-        )
-
-        qry = (
-            session.query(ds.dag_id, ds.state, ds.count)
-        )
+        states = session.query(dr.dag_id, dr.state, 
sqla.func.count(dr.state)).group_by(dr.dag_id, dr.state)
 
         data = {}
 
 Review comment:
   👍 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to