fix(assets): merge ticker renames and re-key price_bars to the current symbol #88
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gertjan/bodega!88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/symbol-rename-rekey"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Renamed tickers left their entire price history stranded under the old
symbol: refresh_symbol_changes skipped every rename whose new symbol
already existed in Mongo (the daily list sync creates it first, so that
was nearly all of them), nothing ever re-keyed price_bars, and the batch
EOD ingest kept accepting FMP rows under the old label. Discovered via
Fiserv (FI/FISV); a production sweep found 75+ affected renames since
Nov 2025 (e.g. KFS→KWY: 6250 bars under KFS, 37 under KWY).
of skipping — mark old doc inactive, record previous_symbols on the
new doc, re-key price_bars old→new. Plain renames re-key too. Changes
are processed newest-first so a reverted rename (FISV→FI→FISV) is not
re-applied; renames outside our universe no longer create stub assets.
New lookback_days/dry_run params for historical backfill via CLI.
rows already present under the new symbol win. Idempotent.
ticker via get_ticker_alias_map, but never when the raw symbol is
itself an active asset (recycled tickers can't be hijacked).
update_symbol's asset_type filter is optional (renames aren't
stock-only — most affected assets were ETFs).
7-day lookback, which silently dropped renames whenever a run misfired)
with watchdog staleness tightened 196h→26h.
rekey-symbol OLD NEW for one-off migrations.
Verified with a read-only dry run against production: 244 merge/rename
actions planned over a 260-day backfill, including FI→FISV.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com