From d12b188861b57454fcf8dff677f112391b4118d1 Mon Sep 17 00:00:00 2001 From: alexjanousekGSA Date: Mon, 24 Feb 2025 18:16:19 -0500 Subject: [PATCH] Fixed bug --- app/dao/services_dao.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/dao/services_dao.py b/app/dao/services_dao.py index 2a0333754..1c8a5e157 100644 --- a/app/dao/services_dao.py +++ b/app/dao/services_dao.py @@ -905,10 +905,12 @@ def get_specific_hours_stats(data, start_date, hours=None, end_date=None, total_ else: raise ValueError("Either hours or end_date must be set.") + # Ensure all hours exist in the output (even if empty) grouped_data = {hour: [] for hour in gen_range} + # Group notifications based on full hour timestamps for row in data: - timestamp = row + notification_type, status, timestamp, count = row row_hour = timestamp.replace(minute=0, second=0, microsecond=0) if row_hour in grouped_data: