File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -53,12 +53,19 @@ def index(request: Request):
5353
5454 batch_stats [batch_name ] = calculate_batch_stats (df , batch_name )
5555
56- # Sort the metric batches by alert count (primary) and avg score (secondary)
56+ # Filter out metric batches where latest_timestamp is "No Data"
57+ filtered_batches = {
58+ name : stats
59+ for name , stats in batch_stats .items ()
60+ if stats ["latest_timestamp" ] != "No Data"
61+ }
62+
63+ # Sort the filtered metric batches by alert count (primary) and avg score (secondary)
5764 sorted_batch_names = sorted (
58- app . state . metric_batches ,
65+ filtered_batches . keys () ,
5966 key = lambda x : (
60- - batch_stats [x ]["alert_count" ], # Negative for descending order
61- - batch_stats [x ]["avg_score" ] # Negative for descending order
67+ - filtered_batches [x ]["alert_count" ], # Negative for descending order
68+ - filtered_batches [x ]["avg_score" ] # Negative for descending order
6269 )
6370 )
6471
You can’t perform that action at this time.
0 commit comments