Skip to content

fix: map renamed yfinance ticker BK -> BNY - #251

Merged
houtanb merged 1 commit into
forecastingresearch:mainfrom
nikbpetrov:yfinance-ticker-rename-bk-bny
Jul 24, 2026
Merged

fix: map renamed yfinance ticker BK -> BNY#251
houtanb merged 1 commit into
forecastingresearch:mainfrom
nikbpetrov:yfinance-ticker-rename-bk-bny

Conversation

@nikbpetrov

@nikbpetrov nikbpetrov commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

https://www.bny.com/corporate/global/en/about-us/newsroom/press-release/bny-announces-planned-change-of-stock-ticker-symbol-to-bny-130465.html

Verified with:

python3 - <<'PY'
import json,urllib.request,datetime as dt
g=lambda s:json.load(urllib.request.urlopen(urllib.request.Request(
  f"https://query1.finance.yahoo.com/v8/finance/chart/{s}?range=6mo&interval=1d",
  headers={"User-Agent":"Mozilla/5.0"})))["chart"]["result"][0]
d=lambda t:dt.datetime.utcfromtimestamp(t).date()
for s in ("BK","BNY"):
    r=g(s); m=r["meta"]
    bars=[(d(t),c) for t,c in zip(r.get("timestamp") or [],
          r["indicators"]["quote"][0].get("close") or []) if c is not None]
    print(f"{s}: {len(bars)} bars {bars[0][0]}..{bars[-1][0]} | "
          f"last real trade {d(m['regularMarketTime'])} @ {m['regularMarketPrice']} | "
          f"firstTradeDate {d(m['firstTradeDate'])}")
PY

Output:

BK:  1 bars   2026-07-10..2026-07-10 | last real trade 2026-05-20 @ 137.16 | firstTradeDate 2026-07-10
BNY: 123 bars 2026-01-14..2026-07-13 | last real trade 2026-07-13 @ 151.27 | firstTradeDate 1973-05-03

Summary by CodeRabbit

  • Bug Fixes

    • Updated ticker handling so the yfinance source recognizes BK as the previous ticker for BNY.
  • Tests

    • Added coverage to verify the new ticker rename mapping.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@houtanb, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 893d9954-d12d-41ae-ad3b-3501822da1ed

📥 Commits

Reviewing files that changed from the base of the PR and between 1956f7f and 4160dcd.

📒 Files selected for processing (2)
  • src/sources/_metadata.py
  • src/tests/test_yfinance.py
📝 Walkthrough

Walkthrough

The yfinance source metadata now maps ticker BK to BNY, and the corresponding test verifies that the rename is defined.

Changes

YFinance ticker rename

Layer / File(s) Summary
Rename metadata and validation
src/sources/_metadata.py, src/tests/test_yfinance.py
Adds the BK to BNY ticker mapping and tests that the mapping is present.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: mapping the renamed yfinance ticker BK to BNY.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@houtanb
houtanb force-pushed the yfinance-ticker-rename-bk-bny branch 2 times, most recently from f09766f to 4160dcd Compare July 24, 2026 15:02
Bank of New York Mellon changed its NYSE ticker from `BK` to `BNY`
effective 2026-05-21. Yahoo Finance migrated all price history to
`BNY`; the `BK` symbol now returns no usable data, so BK questions in
the pool no longer resolve.

Add a `ticker_renames` entry so the updater fetches history under `BNY`
and writes it to `BK`'s resolution file, matching the existing `FI`/`MMC` handling. Extend `test_known_renames_present` with the new mapping.
@houtanb
houtanb force-pushed the yfinance-ticker-rename-bk-bny branch from 4160dcd to 1487763 Compare July 24, 2026 15:03
@houtanb
houtanb merged commit 05f612e into forecastingresearch:main Jul 24, 2026
1 check passed
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.

2 participants