You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2024/02/22 21:25:27 UTC

(airflow) 06/09: fix: sort dag processing stats by last_runtime (#37302)

This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit b441d8834fc99641196f1395118928be85dca68f
Author: Narendra-Neerukonda <na...@gmail.com>
AuthorDate: Wed Feb 21 18:31:07 2024 +0530

    fix: sort dag processing stats by last_runtime (#37302)
    
    * fix: sort dag processing stats by last_runtime
    
    * Update airflow/dag_processing/manager.py
    
    Co-authored-by: Andrey Anshin <An...@taragol.is>
    
    ---------
    
    Co-authored-by: Jarek Potiuk <ja...@potiuk.com>
    Co-authored-by: Andrey Anshin <An...@taragol.is>
    (cherry picked from commit ac6a6373266cb84125cb16051cddf06845bfd4c2)
---
 airflow/dag_processing/manager.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/dag_processing/manager.py b/airflow/dag_processing/manager.py
index b4b4ed65fe..39515e00a4 100644
--- a/airflow/dag_processing/manager.py
+++ b/airflow/dag_processing/manager.py
@@ -851,7 +851,7 @@ class DagFileProcessorManager(LoggingMixin):
             rows.append((file_path, processor_pid, runtime, num_dags, num_errors, last_runtime, last_run))
 
         # Sort by longest last runtime. (Can't sort None values in python3)
-        rows.sort(key=lambda x: x[3] or 0.0)
+        rows.sort(key=lambda x: x[5] or 0.0, reverse=True)
 
         formatted_rows = []
         for file_path, pid, runtime, num_dags, num_errors, last_runtime, last_run in rows: