Fixed bug

This commit is contained in:
alexjanousekGSA
2025-02-24 18:16:19 -05:00
parent 896d26343c
commit d12b188861

View File

@@ -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: