File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -1001,9 +1001,16 @@ def get_agent_report(result_df: pd.DataFrame):
10011001
10021002
10031003def update_global_stats ():
1004- stats = inspect_results .global_report (info .result_df , reduce_fn = inspect_results .summarize_stats )
1005- stats .reset_index (inplace = True )
1006- return stats
1004+ try :
1005+ stats = inspect_results .global_report (
1006+ info .result_df , reduce_fn = inspect_results .summarize_stats
1007+ )
1008+ stats .reset_index (inplace = True )
1009+ return stats
1010+
1011+ except Exception as e :
1012+ warning (f"Error while updating global stats: { e } " )
1013+ return None
10071014
10081015
10091016def update_error_report ():
Original file line number Diff line number Diff line change @@ -251,7 +251,11 @@ def summarize(sub_df):
251251 )
252252 else :
253253 err = sub_df ["err_msg" ].notnull ()
254- n_completed = (err | sub_df ["truncated" ] | sub_df ["terminated" ]).sum ()
254+ n_completed = err .copy ()
255+ for col in ["truncated" , "terminated" ]:
256+ if col in sub_df :
257+ n_completed = n_completed | sub_df [col ]
258+ n_completed = n_completed .sum ()
255259
256260 if n_completed == 0 :
257261 return None
@@ -280,7 +284,12 @@ def summarize_stats(sub_df):
280284
281285 # make sure there are completed runs
282286 err = sub_df ["err_msg" ].notnull ()
283- n_completed = (err | sub_df ["truncated" ] | sub_df ["terminated" ]).sum ()
287+ n_completed = err .copy ()
288+ for col in ["truncated" , "terminated" ]:
289+ if col in sub_df :
290+ n_completed = n_completed | sub_df [col ]
291+ n_completed = n_completed .sum ()
292+
284293 if n_completed == 0 :
285294 return None
286295
You can’t perform that action at this time.
0 commit comments