ashb commented on code in PR #26626:
URL: https://github.com/apache/airflow/pull/26626#discussion_r978471417
##########
airflow/www/views.py:
##########
@@ -3456,10 +3456,7 @@ def grid_data(self):
if run_state:
query = query.filter(DagRun.state == run_state)
- ordering = (DagRun.__table__.columns[name].desc() for name in
dag.timetable.run_ordering)
- dag_runs = query.order_by(*ordering,
DagRun.id.desc()).limit(num_runs).all()
- dag_runs.reverse()
-
+ dag_runs = wwwutils.sorted_dag_runs(query,
ordering=dag.timetable.run_ordering, limit=num_runs)
Review Comment:
This feels more like it should be a method on DagRun class maybe? (That way
this can be used by API or CLI too)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]