fix(migrate): deep glob 排除 *_announce_union.parquet(不同 schema)

deep union 段 glob '*_union.parquet' 误匹配 000852_announce_union.parquet/
932000_announce_union.parquet, 它们无 in_current/was_removed 列(用 adjust_type)
-> KeyError 崩溃。显式 skip _announce_union.parquet 文件。

VPS 验证通过:
- 000852: 1672 rows (in_current=1000, was_removed=672)
- 932000: 2684 rows (in_current=2000, was_removed=684)
- 000300/000905/000016/399001 行数不变(回归 OK)
This commit is contained in:
2026-07-23 23:50:03 +08:00
parent b237c2d7e7
commit d5582fd6f2
+3 -1
View File
@@ -158,9 +158,11 @@ def migrate(db_path: str) -> None:
pool["source"] = "baostock"
print(f"[baostock] pool rows={len(pool)} (300/500/50 全集)")
# 2. 深证 union
# 2. 深证 union (排除 *_announce_union.parquet, 不同 schema)
deep = []
for f in sorted(glob.glob(os.path.join(HIST, "*_union.parquet"))):
if f.endswith("_announce_union.parquet"):
continue
d = pd.read_parquet(f)[["index_code", "code", "code_name",
"in_current", "was_removed"]]
d["source"] = "akshare_cni"