Repository navigation
Fix data refresh crash: US CPI 2026-10 has no 2025-10 counterpart - #235
Merged
Merged
Conversation
…part FRED publishes no CPIAUCSL value for 2025-10, so when the October 2026 index arrived on 11 Nov, us_inflation_note looked up a year-earlier row that does not exist and economy/topics.py crashed with a TypeError, stopping the whole data refresh (run 42980628369). The card would have raised next, and the hook printed the 2026-09 rate beside the 2026-10 index. The note, hook, card and US growth note now use the newest month that has a counterpart and say plainly that the newer month has none; nothing is interpolated. movement() names the comparison when the previous month has no rate instead of calling it "the prior month". Output is byte-identical when every month has a counterpart (topics.py --check passes on main). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vahid-ahmadi
marked this pull request as ready for review
November 11, 2026 10:24
This branch was successfully deployed
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.
Cause
The scheduled Fetch data vintages run 42980628369 (main
e84d8c19) stopped at the pages step:The same run's fetch step shows
written us_cpi: FRED published the 2026-10 CPIAUCSL index (337.476).year_earlier()looks for 2025-10, and the store has no such row. That is not a fetch bug: FRED itself publishes no value for that month. The row is blank in the source CSV:fetch.pydrops the blank, as intended. The recovered vintages (#234) are not involved. This is the first month whose year-earlier counterpart is that hole, so it surfaced only now. It recurs only for 2026-10: from 2026-11 every month has a counterpart again.Three places were affected, not one:
us_inflation_notecrashed (the failure above).stat_card(us_cpi, "yoy")would have raisedRuntimeErrornext.us_inflation_hookprinted the 2026-09 rate beside the 2026-10 index, becauseyoy()skips 2026-10 but the hook tooklatest().Fix
latest_year_on_year(series)returns the newest observation that has a counterpart a year earlier, that counterpart, and any newer observations that have none.movement(): from 2026-11 the "prior month" rate would really be 2026-09's. The text now names that comparison,against 2026-09, the latest earlier rate (2026-10 has none), instead of calling it "the prior month".python3 economy/topics.py --checkpasses against main's committed pages.Tests
tests/test_topics_year_on_year.pyuses a synthetic series with the same hole, because main's data ends at 2026-09 and a test reading the store would pass before the fix.TypeError, the card test withRuntimeError, and the hook test because the hook pairs the wrong index.Pipeline check. The full pipeline ran locally on today's real data:
data/fetch.pyat about 10:03 UTC wrote us_cpi 2026-10, thendata/refresh.py --carry-from data/vintage-refresh --skip-fetchran with this fix.pytest testsgave 3219 passed and 87 skipped, and the append-only check passed.economy/topics.pyand the new test file.Once this merges, dispatching Fetch data vintages on main rebuilds #195.
🤖 Generated with Claude Code