uranusjr commented on code in PR #26626:
URL: https://github.com/apache/airflow/pull/26626#discussion_r979524231
##########
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 function in general includes some UI-specific sorting/slicing logic I
don’t feel right making generic. The inner `_get_run_ordering_expr` probably
should, but I’d rather wait until when we actually reuse it somewhere (we don’t
right now).
--
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]