diff --git a/judgement.py b/judgement.py index 1747110..e069e50 100644 --- a/judgement.py +++ b/judgement.py @@ -202,7 +202,10 @@ def load_previous(day: str, read_mysql=None) -> dict: try: rows = sources._records(reader( # noqa: SLF001 —— 同仓自用 "factor", - f"SELECT {', '.join(_PREV_COLS)} FROM {table} " + # 取全部列而不是只取算迁移用的那五列:这个函数 2026-09-07 起也给计划装配用, + # 它要按环节名索引、再读采信倾向与自我校验——只取五列时环节名是空的, + # 产业研判这一路就整个缺席(周一计划里可用数为零,就是这个原因)。 + f"SELECT * FROM {table} " f"WHERE plan_date >= %s AND plan_date < %s ORDER BY plan_date", (start, day))) except Exception as e: # noqa: BLE001 —— 头一次跑时表还不存在,属正常 print(f" ({table} 读不到历史行,本次全部按第一次见到处理: {e!r})") @@ -211,7 +214,7 @@ def load_previous(day: str, read_mysql=None) -> dict: for r in rows: # 按计划日升序读,同一簇键后来的覆盖先来的 key = str(r.get("cluster_key") or "").strip() if key: - out[key] = dict(r) + out[key] = {k: _blank_to_none(v) for k, v in dict(r).items()} return out