fix(backtest): result_id 用 DB 行 id + equity/trades 落 JSON(S1.1+S1.2)
- BacktestResult 加 id;save_result 设 result.id=lastrowid(修 get_result bug) - runner._on_done 用 result.id(getattr 兜底 FactorReport) - cta_engine 构建 equity_curve/trades DataFrame;save 传 file_dir - result_store parquet→JSON(去 pyarrow 依赖,本机/容器都稳) - 16 tests passed
This commit is contained in:
@@ -132,7 +132,9 @@ class Orchestrator:
|
||||
await self._notify_stage(task_id, "完成")
|
||||
return
|
||||
|
||||
task.complete(result_id=id(result))
|
||||
# S1.1: use the persisted DB row id (BacktestResult.id) so get_result can
|
||||
# load_result(result.id). FactorReport (no .id) falls back to None until S2.
|
||||
task.complete(result_id=getattr(result, "id", None))
|
||||
await self._notify_stage(task_id, "完成")
|
||||
|
||||
def get_status(self, task_id: str) -> TaskState | None:
|
||||
|
||||
Reference in New Issue
Block a user