Repository navigation
Conversation
This was referenced Nov 24, 2026
bashtage
force-pushed
the
wip-news-summary-empty-details
branch
from
November 27, 2026 00:31
04540d2 to
264bebd
Compare
When the news has no updates (for example comparison_type="updated" with the same observations and a revision) or no revisions, its details table has no rows at all. Selecting from it, as summary_details(impact_date=..., impacted_variable=..., update_date=... or updated_variable=...) and summary(impact_date=...) do, raised a KeyError, because the label is not in the index of the empty table. statsmodels#11118 lets a label whose impacts are all within the tolerance select no rows; this is the case of a table without any rows. Stacked on statsmodels#11118 (selections of dates and variables whose impacts are all within the tolerance), which changes the same functions. Changes - The details tables of the news and of the revisions select the rows of the key only if they have rows, as they already did for the impacted variable of the results. Not changed - A label that is not in a details table with rows still raises a KeyError. Tests (test_news.py) - Without news (an "updated" comparison without new observations) and without revisions (an AR(1) with one new observation), each selection gives the details table with only its header, the same as without a selection. - summary(impact_date=...) without news has the impacts table of that date, the revisions table and the details of the revisions; the impacts of the revision of 2009Q3 from 0 are its observed value and half of it (phi = 0.5) for the forecast of 2009Q4. - All nine fail on statsmodels#11118.
bashtage
force-pushed
the
wip-news-summary-empty-details
branch
from
November 28, 2026 22:06
264bebd to
7ef80fd
Compare
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.
#11118, which this PR was stacked on, is merged. It changes the selection lines that #11118 adds. No conflict in news.py with the other open news PRs; test_news.py conflicts with #11081, #11119, #11131 and #11132 only where both append tests at the end: keep both blocks.
BUG: Allow selections in NewsResults details tables without rows
When the news has no updates (for example comparison_type="updated" with
the same observations and a revision) or no revisions, its details table
has no rows at all. Selecting from it, as summary_details(impact_date=...,
impacted_variable=..., update_date=... or updated_variable=...) and
summary(impact_date=...) do, raised a KeyError, because the label is not in
the index of the empty table. #11118 lets a label whose impacts are all
within the tolerance select no rows; this is the case of a table without
any rows.
Stacked on #11118 (selections of dates and variables whose impacts are all
within the tolerance), which changes the same functions.
Changes
the key only if they have rows, as they already did for the impacted
variable of the results.
Not changed
KeyError.
Tests (test_news.py)
Without news (an "updated" comparison without new observations) and
without revisions (an AR(1) with one new observation), each selection
gives the details table with only its header, the same as without a
selection.
summary(impact_date=...) without news has the impacts table of that
date, the revisions table and the details of the revisions; the impacts
of the revision of 2009Q3 from 0 are its observed value and half of it
(phi = 0.5) for the forecast of 2009Q4.
All nine fail on BUG: Allow NewsResults summaries of dates without impacts above the tolerance #11118.
tests added / passed.
code/documentation is well formatted.
properly formatted commit message. See
NumPy's guide.
AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Tick exactly one of the following. If AI tools were used, replace the
<...>placeholders in the second option with the tool name(s) and how the tool's output was
used.
Tool(s): Claude Code (Claude Opus 5.5).
Used for: finding the bug in a coverage audit of the state space code, writing the fix and its tests, and checking them (tests failing on the base, mutation check).
I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.
🤖 Generated with Claude Code