fix: Handle timeout exceptions safely in predix_full_eval.py

Problem:
- When factor evaluation timed out (5 min), result was undefined
- save_single_result(result) crashed with NameError
- factor.factor_name[:40] could fail if factor_name wasn't a string

Fix:
- Initialize result = None before try block
- Set result to failed EvalResult on exception
- Only call save_single_result() if result is not None
- Use getattr(factor, 'factor_name', 'unknown') for safe access
- Convert to string before slicing [:40]

Now the evaluator continues even when individual factors timeout.
This commit is contained in:
TPTBusiness
2026-04-05 12:24:04 +02:00
parent 12c949b0b4
commit e31a2e5405
2 changed files with 12 additions and 4 deletions
+1
View File
@@ -102,3 +102,4 @@ test_credentials.py
# Closed source local components
rdagent/scenarios/qlib/local/
docs/COMPLETE_WORKFLOW.md