revert 3bafd30aad
revert feat(HEL-529): 按定稿100%重做三页数据中枢 + 数据修正1-5
视觉:admin/app.js 按已确认打样 hub-kimi.html 逐行重写三页 DOM 与动效
(sparkline/缓存年龄秒增/延迟变化闪烁/EVENT TAPE 预装滚动/分组接口表/
更新频率列/时钟冒号 blink/雷达 blip),CSS 补真实调用脉冲 node-ping。
数据修正:
1) pipeline._stage 批内按暂存表业务键确定性去重(保留最后一条),
修复人气榜/龙虎榜自 09-07 起每日 UNIQUE constraint 落库失败;
2) overview.anomalies 收敛为「最新批次未成功且当日未发布」的当前异常,
历史已恢复批次留在审计明细;
3) source_catalog 接口补真实批次分组 + 观测 join(接口名或数据集名
双向匹配,标注 observed/observed_basis),消除「全部未配置/0/30」误报;
4) lineage 逐数据集按其服务接口过滤健康行(接口级状态),
provisional 已配置无观测显示「已配置 · 待观测」,仅 iFinD 为未配置;
5) lineage 补 update_freq 真实频率字段。
测试:新增 tests/test_hel529_rework.py(8 项),全套 191 项通过
(1 项环境依赖失败在基线 d9358ab 上同样复现,与本改动无关)。
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -31,18 +31,10 @@ class AdminAPI:
|
||||
)
|
||||
is_open = bool(cal and int(cal["is_open"]) == 1)
|
||||
pubs = self.db.fetchall("SELECT * FROM publications WHERE trade_date = ?", (today,))
|
||||
# HEL-529 fix 2: "待处理"只保留当前仍未恢复的最新异常。一条失败/停滞
|
||||
# 批次若已被同数据集更晚的成功批次或当日发布解决,就不再是当前故障,
|
||||
# 历史记录仍完整保留在 batches/audit 明细里,不在此重复展示。
|
||||
latest_by_dataset: dict[str, dict[str, Any]] = {}
|
||||
for row in self.db.fetchall("SELECT * FROM batches WHERE trade_date = ? ORDER BY started_at, batch_id", (today,)):
|
||||
latest_by_dataset[row["dataset"]] = row
|
||||
published_datasets = {row["dataset"] for row in pubs if row["state"] == "published"}
|
||||
anomalies = [
|
||||
row
|
||||
for dataset, row in latest_by_dataset.items()
|
||||
if dataset not in published_datasets and row["state"] in ("failed", "staged")
|
||||
]
|
||||
failed = self.db.fetchall(
|
||||
"SELECT * FROM batches WHERE trade_date = ? AND state IN ('failed','staged')",
|
||||
(today,),
|
||||
)
|
||||
calls = self.db.fetchall(
|
||||
"SELECT * FROM src_calls ORDER BY id DESC LIMIT 20",
|
||||
)
|
||||
@@ -53,7 +45,7 @@ class AdminAPI:
|
||||
"eod_status": self.scheduler.eod_status(today),
|
||||
"revision_status": self.scheduler.revision_status(today),
|
||||
"publications": pubs,
|
||||
"anomalies": anomalies,
|
||||
"anomalies": failed,
|
||||
"recent_calls": _public_calls(calls),
|
||||
"source_count": len(self.db.fetchall("SELECT provider FROM src_health")),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user