From 5d8c7476ff1aed1c771b2a94696d721f4874d419 Mon Sep 17 00:00:00 2001 From: hmo Date: Wed, 22 Jul 2026 12:52:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=8C=E4=B8=9A=E6=9C=AA=E6=98=A0?= =?UTF-8?q?=E5=B0=84=E6=97=B6=E8=AF=9A=E5=AE=9E=E6=A0=87=E6=B3=A8=EF=BC=8C?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E5=A4=A7=E7=9B=98=E6=8C=87=E6=A0=87=E4=BC=AA?= =?UTF-8?q?=E8=A3=85=E6=88=90=E8=A1=8C=E4=B8=9A=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/batch_reassess.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deploy/profile-scripts/batch_reassess.py b/deploy/profile-scripts/batch_reassess.py index 834e8e01..14420474 100644 --- a/deploy/profile-scripts/batch_reassess.py +++ b/deploy/profile-scripts/batch_reassess.py @@ -124,17 +124,20 @@ def collect_data(code): except: data["price"] = 0 - # 行业上下文修正:sector_context 被"大盘上涨比"污染或为空时,用 stock_sectors 的行业名兜底 + # 行业上下文修正:sector_context 被"大盘上涨比"污染或为空时,用 stock_sectors 的行业名兜底; + # 未映射的股票明确标注"行业未映射"(不让大盘指标伪装成行业信息) _sector_ctx = data.get('sector_context', '') or '' if (not _sector_ctx) or _sector_ctx.startswith('大盘上涨比') or len(_sector_ctx) < 4: + _resolved = "" try: _sdb = sqlite3.connect(DB) _sr = _sdb.execute("SELECT sector_name FROM stock_sectors WHERE code=? LIMIT 1", (code,)).fetchone() _sdb.close() if _sr and _sr[0]: - _sector_ctx = f"行业{_sr[0]}" + _resolved = f"行业{_sr[0]}" except Exception: pass + _sector_ctx = _resolved if _resolved else "行业未映射(仅大盘环境参考)" data['sector_context'] = _sector_ctx # 大盘 try: