From 6b67f284fa88b55be0147201323098416efc3a6f Mon Sep 17 00:00:00 2001 From: ydshieh Date: Fri, 21 Apr 2023 04:19:45 +0200 Subject: [PATCH 1/2] fix --- utils/get_previous_daily_ci.py | 2 +- utils/notification_service.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/get_previous_daily_ci.py b/utils/get_previous_daily_ci.py index 0bcb7fc89008..4e4cb0a8c10d 100644 --- a/utils/get_previous_daily_ci.py +++ b/utils/get_previous_daily_ci.py @@ -57,9 +57,9 @@ def get_last_daily_ci_reports(artifact_names, output_dir, token): results = {} for artifact_name in artifact_names: - results[artifact_name] = {} artifact_zip_path = os.path.join(output_dir, f"{artifact_name}.zip") if os.path.isfile(artifact_zip_path): + results[artifact_name] = {} with zipfile.ZipFile(artifact_zip_path) as z: for filename in z.namelist(): if not os.path.isdir(filename): diff --git a/utils/notification_service.py b/utils/notification_service.py index bbdd4e996de8..7fa360879a21 100644 --- a/utils/notification_service.py +++ b/utils/notification_service.py @@ -423,8 +423,8 @@ def per_model_sum(model_category_dict): artifact_names=artifact_names, output_dir=output_dir, token=os.environ["ACCESS_REPO_INFO_TOKEN"] ) - # The last run doesn't produce `test_failure_tables` (by some issues or have no model failure at all) - if len(prev_tables) > 0: + # if the last run produces artifact named `test_failure_tables` + if "test_failure_tables" in prev_tables and "model_failures_report.txt" in prev_tables["test_failure_tables"]: # Compute the difference of the previous/current (model failure) table prev_model_failures = prev_tables["test_failure_tables"]["model_failures_report.txt"] entries_changed = self.compute_diff_for_failure_reports(model_failures_report, prev_model_failures) From baa796d39b9574fab37a28782054041521d2e795 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Fri, 21 Apr 2023 04:28:41 +0200 Subject: [PATCH 2/2] fix --- utils/notification_service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/notification_service.py b/utils/notification_service.py index 7fa360879a21..b58c0324c5e4 100644 --- a/utils/notification_service.py +++ b/utils/notification_service.py @@ -424,7 +424,10 @@ def per_model_sum(model_category_dict): ) # if the last run produces artifact named `test_failure_tables` - if "test_failure_tables" in prev_tables and "model_failures_report.txt" in prev_tables["test_failure_tables"]: + if ( + "test_failure_tables" in prev_tables + and "model_failures_report.txt" in prev_tables["test_failure_tables"] + ): # Compute the difference of the previous/current (model failure) table prev_model_failures = prev_tables["test_failure_tables"]["model_failures_report.txt"] entries_changed = self.compute_diff_for_failure_reports(model_failures_report, prev_model_failures)