ashb commented on a change in pull request #15397:
URL: https://github.com/apache/airflow/pull/15397#discussion_r644668430
##########
File path: airflow/www/views.py
##########
@@ -2298,8 +2298,10 @@ def duration(self, session=None):
else:
base_date = dag.get_latest_execution_date() or timezone.utcnow()
- dates = dag.date_range(base_date, num=-abs(num_runs))
- min_date = dates[0] if dates else timezone.utc_epoch()
+ min_date = next(
+ dag.time_table.iter_next_n(base_date, 1),
+ timezone.utc_epoch(),
+ )
Review comment:
I think this needs to be something like:
```
SELECT execution_date FROM dag_run WHERE .... ORDER BY execution_date DESC
OFFSET ? LIMIT 1
```
with `abs(num_runs)` as the offset.
I _think_
--
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]