Skip to content

fix: 日线同步改为逐股票精确增量#10

Merged
xbfighting merged 1 commit into
masterfrom
fix/daily-per-stock-incremental
Jun 12, 2026
Merged

fix: 日线同步改为逐股票精确增量#10
xbfighting merged 1 commit into
masterfrom
fix/daily-per-stock-incremental

Conversation

@xbfighting

Copy link
Copy Markdown
Owner

Summary

  • sync 日线用全表 MAX(date) 做统一增量起点,库里没有的新股票全历史被 filter 过滤为空,静默 0 行入库。本次 fix: 股票列表纳入科创板 688 与创业板 301 段 #9 合入后首次同步科创/301 时暴露:分钟线(已是逐股票精确增量)54 只入库,日线 0 行
  • get_latest_datetime_by_code 增加 date_column 参数('datetime'/'date' 白名单),日线复用该方法逐股票查增量起点
  • 新股 latest=None → 全历史;老股从自己最新日期+1 起

Test plan

  • Dry-run 三路径:sh688981(新股,None → 1426 行全历史)/ sh600519(老股,2026-06-13 → 0 行)/ sz301236(新股,None → 1029 行)
  • 全量 sync 后验证 daily_data 中 688=609 只 / 301=461 只
  • 老股票行数不变(无重复插入,ON CONFLICT 兜底)

🤖 Generated with Claude Code

sync 用全表 MAX(date) 做统一起点,库里没有的新股票全历史被
filter_data 过滤为空,静默 0 行入库(20260612 科创/301 首次
同步踩坑:分钟线 54 只已入库而日线 0 行才暴露)。

- get_latest_datetime_by_code 加 date_column 参数(白名单校验)
- sync_all_daily_data 逐股票查 MAX(date),新股 latest=None 走全历史
- sync 编排去掉全局 start_date 推导

Dry-run 验证:sh688981 (None->1426行) / sh600519 (06-13->0行) /
sz301236 (None->1029行)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@xbfighting xbfighting merged commit 8eda04c into master Jun 12, 2026
0 of 3 checks passed
@xbfighting xbfighting deleted the fix/daily-per-stock-incremental branch June 12, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant