Fix HK historical data provider routing - #1232
Merged
Merged
Conversation
🤖 自动审查报告
📁 修改的文件
🧠 AI 代码审查意见结论: 结构化审查结果:
|
ZhuLinsen
force-pushed
the
codex/fix-hk-data-provider-routing
branch
from
May 8, 2026 14:16
73f58dd to
28f7764
Compare
ZhuLinsen
marked this pull request as ready for review
May 8, 2026 14:33
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes incorrect Hong Kong (HK) daily historical price routing by making DataFetcherManager market-aware for daily-history fetcher selection, ensuring HK codes don’t get handled by built-in providers that are known to return mismatched/non-HK data.
Changes:
- Add HK market filtering for daily-history fetchers in
DataFetcherManagerto skip incompatible built-in providers before attempting HK-capable ones. - Add a defensive guard in
EfinanceFetcherto explicitly reject HK daily history when called directly. - Add regression tests plus documentation/changelog updates describing the HK daily routing behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
data_provider/base.py |
Adds market-aware filtering for daily-history fetchers and applies it for HK daily requests before the standard fallback loop. |
data_provider/efinance_fetcher.py |
Rejects HK daily history early to avoid accidental Eastmoney historical K-line calls that can return wrong-market data. |
tests/test_fetcher_logging.py |
Adds offline regression tests verifying HK daily routing skips incompatible built-ins and that efinance rejects HK daily without hitting Eastmoney. |
docs/full-guide.md |
Documents that HK daily history skips incompatible built-in providers and uses HK-capable fallbacks. |
docs/full-guide_EN.md |
English counterpart documentation for HK daily routing behavior. |
docs/CHANGELOG.md |
Adds an [Unreleased] fix entry describing the HK daily provider routing change. |
ZhuLinsen
commented
May 8, 2026
ZhuLinsen
left a comment
Owner
Author
There was a problem hiding this comment.
评审结论
- 必要性:通过,修复港股日线可能被不支持港股的内置数据源错误接收并返回错配价格的问题,动机明确。
- 是否有对应 issue:有,Fixes #1231。
- PR 类型:fix/test/docs,核心是修复港股历史数据源路由,并补充离线回归测试与中英文文档/CHANGELOG。
- description 完整性:完整,已覆盖问题背景、根因、改动范围、验证命令与结果、兼容性风险、回滚方案和
EXTRACT_PROMPT说明,符合 AGENTS.md 对 fix 类 PR 的交付要求。 - 是否可直接合入:可,当前 CI 为 success,
backend-gate与ai-governance已通过;mergeable_state=blocked在本仓库规则下不单独构成阻断。
🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。
1 task
cwjyu
pushed a commit
to cwjyu/daily_stock_analysis
that referenced
this pull request
May 10, 2026
zbl-96
pushed a commit
to zbl-96/daily_stock_analysis
that referenced
this pull request
May 10, 2026
1 task
EchoingFootsteps
pushed a commit
to EchoingFootsteps/daily_stock_analysis
that referenced
this pull request
Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Background And Problem
Issue #1231 reports HK stock
1211.HKreturning an obviously wrong price around 30 when BYD H shares should be above 100 HKD. The root cause is that HK daily history still used the generic historical fetcher priority, so built-in providers that do not support HK daily history could receiveHK01211before an HK-capable provider handled it.Scope Of Change
docs/full-guide.md,docs/full-guide_EN.md, anddocs/CHANGELOG.md.Issue Link
Fixes #1231
Verification Commands And Results
Key output / conclusion:
5 passed in 0.54s1738 passed, 2 deselected, 49 warnings, 154 subtests passed./scripts/ci_gate.sh: all checks passedCompatibility And Risk
HK daily history no longer attempts built-in providers known not to support HK daily data before reaching HK-capable providers. This reduces market mismatch risk while keeping normal fallback through AkShare/Tushare/YFinance/Longbridge.
No new runtime configuration is introduced. Unknown custom fetchers are left in the route by default to avoid breaking extension use cases.
Rollback Plan
Revert this PR to restore the previous historical fetcher behavior. No config or data migration rollback is required.
EXTRACT_PROMPT Change (if applicable)
Not applicable.
Checklist
docs/CHANGELOG.md;README.md仅在首页级信息变化时更新,细节优先写入docs/*.md/ If user-visible changes are included, relevant docs anddocs/CHANGELOG.mdare updated;README.mdis updated only for homepage-level changes, with details kept indocs/*.md