Skip to content

fix: preserve TPEx market in Yahoo OHLCV fallback (#481)#497

Merged
cct08311github merged 1 commit intomainfrom
fix/issue-481-tpex-fallback
Mar 28, 2026
Merged

fix: preserve TPEx market in Yahoo OHLCV fallback (#481)#497
cct08311github merged 1 commit intomainfrom
fix/issue-481-tpex-fallback

Conversation

@cct08311github
Copy link
Copy Markdown
Owner

Summary

  • fetch_ohlcv_yahoo(): TPEx symbols now use .TWO suffix (was .TW for all)
  • run_daily_fetch(): builds symbol→market lookup, TPEx symbols skip TWSE STOCK_DAY and go directly to Yahoo
  • Yahoo INSERT uses parameterized :market preserving original market (was hardcoded 'TWSE')

Root Cause

Commit 6608f5c added Yahoo fallback but hardcoded market='TWSE' and .TW suffix for all symbols. TPEx symbols (89,507 rows in eod_prices) were being mislabeled and fetched from wrong Yahoo endpoint.

Test plan

  • 4 new regression tests in TestTPExYahooFallback
  • Full test_market_data_fetcher.py: 55/55 passed

Fixes #481

🤖 Generated with Claude Code

- fetch_ohlcv_yahoo: accepts market_map param; TPEx symbols use .TWO
  suffix, TWSE symbols use .TW
- run_daily_fetch: builds symbol→market lookup from existing eod_prices;
  TPEx symbols skip TWSE STOCK_DAY, go directly to Yahoo fallback
- Yahoo INSERT uses parameterized :market instead of hardcoded 'TWSE'
- 4 new regression tests in TestTPExYahooFallback (55 total)

Fixes #481
@cct08311github cct08311github merged commit fb51090 into main Mar 28, 2026
5 checks passed
@cct08311github cct08311github deleted the fix/issue-481-tpex-fallback branch March 28, 2026 19:27
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.

bug: preserve TPEx market in Yahoo OHLCV fallback

1 participant