You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bbovenzi (via GitHub)" <gi...@apache.org> on 2023/05/02 17:53:25 UTC

[GitHub] [airflow] bbovenzi commented on a diff in pull request #30935: Support for sorting DAGs by Last Run Date in the web UI

bbovenzi commented on code in PR #30935:
URL: https://github.com/apache/airflow/pull/30935#discussion_r1182866414


##########
airflow/www/views.py:
##########
@@ -776,11 +776,28 @@ def index(self):
                 current_dags = all_dags
                 num_of_all_dags = all_dags_count
 
-            sort_column = DagModel.__table__.c.get(arg_sorting_key)
-            if sort_column is not None:
+            if arg_sorting_key == "last_dagrun":
+                dag_run_subquery = (
+                    session.query(
+                        DagRun.dag_id,
+                        sqla.func.max(DagRun.execution_date).label("max_execution_date"),

Review Comment:
   If there is no latest dag run, those dags should be shown last for either asc or desc sort.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org