ashb commented on a change in pull request #4396: [AIRFLOW-3585] - Add edges to 
database
URL: https://github.com/apache/airflow/pull/4396#discussion_r256767119
 
 

 ##########
 File path: airflow/www/views.py
 ##########
 @@ -92,7 +93,10 @@ def get_date_time_num_runs_dag_runs_form_data(request, 
session, dag):
     if dttm:
         dttm = pendulum.parse(dttm)
     else:
-        dttm = dag.latest_execution_date or timezone.utcnow()
+        execution_date = 
session.query(sqla.func.max(DagRun.execution_date)).filter(
+            DagRun.dag_id == dag.dag_id
+        ).scalar()
 
 Review comment:
   Why have you expanded this? Isn't that exactly what 
`dag.last_execution_date` does? (and keeps DB access logic out of the views 
which makes me happier)

----------------------------------------------------------------
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