Skip to content

Commit bba8580

Browse files
committed
revert to old explanation if api call fails
1 parent 28318cf commit bba8580

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ def find_and_process_best_optimization(
11341134
annotated_tests=generated_tests_str,
11351135
optimization_id=best_optimization.candidate.optimization_id,
11361136
)
1137-
new_explanation = Explanation(raw_explanation_message=new_explanation_raw_str, winning_behavior_test_results=explanation.winning_behavior_test_results,
1137+
new_explanation = Explanation(raw_explanation_message=new_explanation_raw_str or explanation.raw_explanation_message, winning_behavior_test_results=explanation.winning_behavior_test_results,
11381138
winning_benchmarking_test_results=explanation.winning_benchmarking_test_results,
11391139
original_runtime_ns=explanation.original_runtime_ns,
11401140
best_runtime_ns=explanation.best_runtime_ns,

0 commit comments

Comments
 (0)