Skip to content

Commit

Permalink
fix: sort dag processing stats by last_runtime (apache#37302)
Browse files Browse the repository at this point in the history
* fix: sort dag processing stats by last_runtime

* Update airflow/dag_processing/manager.py

Co-authored-by: Andrey Anshin <Andrey.Anshin@taragol.is>

---------

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Andrey Anshin <Andrey.Anshin@taragol.is>
  • Loading branch information
3 people authored and abhishekbhakat committed Mar 5, 2024
1 parent cdfcac3 commit 993000b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/dag_processing/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ def _log_file_processing_stats(self, known_file_paths):
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:
Expand Down

0 comments on commit 993000b

Please sign in to comment.