Private
Public Access
0
0

Backfill recent review stock names

Request:
Explain and fix why the recent 30-day listed IPO review showed data_gap in the 股票名 column.

Cause:
The recent review sample was seeded from HKEX annual new-listing reports, which only carried English issuer names in ipo_master. The archived ipohk external history already had display stock names, but build_analysis_dataset.py did not expose external_ipo_history.stock_name as a stock_short_name fallback.

Changes:
- Use external_ipo_history.stock_name as a stock_short_name fallback in the analysis dataset after the official/master and market-heat display-name sources.
- Backfill blank ipo_master.stock_short_name values when future ipohk history archives carry a stock name.
- Document the external-history display-name fallback in the analyst skill.
- Refresh the latest report and README so the recent 30-day review shows stock names for 00901, 02723, 03310, 03388, 02553, 01081, 01779, and 02290.

Verification:
- python3 /root/.codex/skills/.system/skill-creator/scripts/quick_validate.py .agents/skills/hk-ipo-analyst
- .venv/bin/python -m py_compile scripts/archive_ipohk_history.py scripts/build_analysis_dataset.py
- git diff --check
- Rebuilt analysis_model_v0_dataset.csv for 2026-06-23T10:59:36Z
- Python check that README matches the dated latest report and recent-review stock-name cells are no longer data_gap
This commit is contained in:
2026-06-23 13:30:18 +00:00
parent 40d748cda8
commit 7a15df3430
6 changed files with 137 additions and 119 deletions
+12
View File
@@ -177,6 +177,17 @@ def upsert_history(
notes,
),
)
stock_name = str(row.get("name") or "").strip()
if stock_name:
conn.execute(
"""
UPDATE ipo_master
SET stock_short_name = ?, data_as_of = ?
WHERE ticker = ?
AND (stock_short_name IS NULL OR TRIM(stock_short_name) = '')
""",
(stock_name, as_of, ticker),
)
written += 1
return written
@@ -198,6 +209,7 @@ def main() -> int:
written = upsert_history(conn, rows, local_path, file_sha256, args.url, as_of, notes)
write_sync_run(conn, as_of, written)
export_snapshot(conn, "external_ipo_history", "listing_date DESC, ticker")
export_snapshot(conn, "ipo_master", "ticker")
export_snapshot(conn, "sync_runs", "sync_run_id")
print("ipohk history archived")