@@ -22,14 +22,14 @@ class PrComment:
2222 winning_benchmarking_test_results : TestResults
2323 benchmark_details : Optional [list [BenchmarkDetail ]] = None
2424
25- def to_json (self ) -> dict [str , Union [dict [str , dict [str , int ]], int , str , Optional [list [dict [ str , any ] ]]]]:
25+ def to_json (self ) -> dict [str , Union [dict [str , dict [str , int ]], int , str , Optional [list [BenchmarkDetail ]]]]:
2626 report_table = {
2727 test_type .to_name (): result
2828 for test_type , result in self .winning_behavioral_test_results .get_test_pass_fail_report_by_type ().items ()
2929 if test_type .to_name ()
3030 }
3131
32- result = {
32+ return {
3333 "optimization_explanation" : self .optimization_explanation ,
3434 "best_runtime" : humanize_runtime (self .best_runtime ),
3535 "original_runtime" : humanize_runtime (self .original_runtime ),
@@ -39,14 +39,9 @@ def to_json(self) -> dict[str, Union[dict[str, dict[str, int]], int, str, Option
3939 "speedup_pct" : self .speedup_pct ,
4040 "loop_count" : self .winning_benchmarking_test_results .number_of_loops (),
4141 "report_table" : report_table ,
42+ "benchmark_details" : self .benchmark_details if self .benchmark_details else None ,
4243 }
4344
44- # Add benchmark details if available
45- if self .benchmark_details :
46- result ["benchmark_details" ] = self .benchmark_details
47-
48- return result
49-
5045
5146class FileDiffContent (BaseModel ):
5247 oldContent : str
0 commit comments