From 05c5e2f88998e610b149c0a9b625f0be83e355f4 Mon Sep 17 00:00:00 2001 From: zlt Date: Mon, 7 Sep 2026 09:33:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E4=B8=8A=E4=B8=80=E7=89=88=E5=BF=AB?= =?UTF-8?q?=E7=85=A7=E6=94=B9=E4=B8=BA=E5=8F=96=E5=85=A8=E9=83=A8=E5=88=97?= =?UTF-8?q?=E5=B9=B6=E5=BD=92=E4=B8=80=E7=A9=BA=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这个函数 2026-09-07 起也给计划装配用,要按环节名索引、再读采信倾向与自我校验。 原先只取算迁移用的五列,环节名是空的,按环节索引必然为空,产业研判这一路整个缺席。 上一处修改(读 ds 当天或之前的最近一版)方向对了,但被这一层挡住,周一计划里可用数 仍为零。 Co-Authored-By: Claude Fable 5.1 --- judgement.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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