From e3c04d16f5bd68744ce9ff155d1b629203972f09 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Fri, 9 Jun 2023 10:58:01 -0700 Subject: [PATCH] fix: time to first response being none caused sort failure Signed-off-by: Zack Koppert --- issue_metrics.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/issue_metrics.py b/issue_metrics.py index 298315b..7ea3b53 100644 --- a/issue_metrics.py +++ b/issue_metrics.py @@ -187,7 +187,9 @@ def write_to_markdown( file.write("no issues found for the given search criteria\n\n") else: # Sort the issues by time to first response - issues_with_metrics.sort(key=lambda x: x.time_to_first_response) + issues_with_metrics.sort( + key=lambda x: x.time_to_first_response or timedelta.max + ) with file or open("issue_metrics.md", "w", encoding="utf-8") as file: file.write("# Issue Metrics\n\n") file.write("| Metric | Value |\n")