Repository navigation
Read every summary supply-use year from the 1997-2024 workbook, matching gross output (#1157) - #1166
Open
WesIngwersen wants to merge 4 commits into
Open
WesIngwersen wants to merge 4 commits into
WesIngwersen wants to merge 4 commits into
Conversation
…#1157) 2017-2022 were pinned to the superseded 2017-2022 workbook while gross output (UGO305-A) is on the 2025Q2 release; in 2022 the two disagree by $1.32T (absolute, commodity output). The workbooks agree exactly on 2017. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ummary_sut_single_vintage
…update (#1157) Each source is tied to its annual update by content, not by file name or date: an update released in September of year Y publishes through Y - 1. assemble() raises on a mismatch and warns when both trail the newest update (2026). Today both are the 2025 update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… warning test The bedrock logger sets propagate=False, so in the full suite caplog saw nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
Closed
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.
Closes #1157. Stacked on #1162. It is held for a combined overnight rebuild, and nothing has been rebuilt with this change yet.
What was wrong
_load_usa_summary_sutread 2017–2022 fromSupply_Tables_2017-2022_Summary.xlsx(and the matching Use workbook). Only 2023–2024 came from the 1997–2024 workbook. Gross output (UGO305-A,BEA_DATA_VERSION = "2025Q2") is on the newer release for every year. As a result, the 2018–2022 summary controls disagreed with the gross output they are balanced against. In 2022, the absolute revisions to commodity output between the two workbooks add up to $1.32T across the 73 commodity rows.The change
_load_usa_summary_sutreadsUSA_SUMMARY_SUT_MAPPING_1997_2024for every year. The two workbooks agree exactly on 2017, so 2017 does not move.USA_SUMMARY_SUT_MAPPING_2017_2022is no longer read by any loader. It stays only to name the superseded workbook.matrix_mappings.pyandnowcast_intermediate.pythat described the old year split are updated.nowcast_intermediatealready read the 1997–2024 workbook for every year, so its numbers do not change.The annual-update check
A new module,
extract/iot/bea_annual_update.py, checks that gross output and the summary supply-use tables come from the same BEA annual update.nowcast_sut_assembly.assemble()runs the check first and raises if they differ. That means the old pin would have stopped the build.The check does not rely on file names, GCS folders or release dates.
BEA_DATA_VERSIONis a BEA Data Archive label, and the supply-use workbooks carry no release stamp. Instead, each source is tied to its update by its content: an annual update released in September of year Y publishes data through Y − 1.UGO305-A,2025Q2(what the build uses)UGO305-A,2026Q2NEWEST_BEA_ANNUAL_UPDATE = 2026records the 30 September 2026 release. Today both inputs are on the 2025 update, so the check passes and logs a warning that 2026 is newer. Moving to the 2026 update would mean a2026Q2gross output pin and the 1997–2025 summary workbooks, changed together. #1167, stacked on this PR, makes that move and adds the components-of-value-added archive to the check.Unit tests cover the rule, a match, a mismatch, and the warning (
extract/iot/__tests__/test_bea_annual_update.py). They need no data.What moves
Everything that reads the summary supply-use tables for 2018–2022:
nowcast_trade_margins);nowcast_import_conditioning);nowcast_fd_conditioning);nowcast_va_taxes);trade/madj.py).BEA_Summary_SupplyandBEA_Summary_Use_SUT, and the methods built on them:Detail_Supply_Mix_*andDetail_Use_SUT.CAP_HAP_{Nonpoint,Nonroad,Onroad}_2020read the 2020 summary Supply table. Revisions to 2020 commodity output total $246bn in absolute terms.Before the rebuild
These cached parquets are named by commit, not by their inputs. The 2018–2022 cached
BEA_Summary_SupplyandBEA_Summary_Use_SUTtables, and the flow-by-sector methods built on them, must be cleared, or they will keep serving the old workbook's numbers.Acceptance, after the rebuild
Checks run locally
black --check,ruff checkandmypyare clean on the changed files. The new unit tests pass. The live check against the real workbooks returns 2025 for both sources. The suite is left to CI.🤖 Generated with Claude Code