Repository navigation
Conversation
Unfiltered, 25 EIA datasets match more rows than MAX_AUTO_ROWS (500,000),
and the provider refuses an unbounded request over that ceiling ("Narrow
the request with facet filters or dates, or set an explicit limit"). Their
widgets opened with no limit, so every one of them failed on first open.
Those widgets now default to limit=5000 and a hidden sort=desc, so they open
on the newest page of data. Only the widget metadata changes: the REST
defaults (full pagination, ascending) are unchanged, and the user can still
change the limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dlee-bq
requested changes
Oct 18, 2026
Contributor
There was a problem hiding this comment.
Thanks for the PR, @artcashin.
I agree that some endpoints require practical default values, the bulk data sources and spreadsheet files are more appropriate for mining the full dataset.
These types of considerations should get baked in to the generate_catalog and api_query utilities layer instead of patching at the router level.
This branch has not been 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.
Problem
Opened with their defaults, 25 EIA dataset widgets fail. With no filters and no
limit, those datasets match more rows thanMAX_AUTO_ROWS(500,000), soapi_queryrefuses the request by design:The refusal is right for the API, but the widgets offer no default that avoids it, so every one of them fails on first open. They include AEO, IEO, International, SEDS, three electricity datasets, four electricity grid datasets, two nuclear outage datasets and twelve petroleum datasets.
Change
Only the widget metadata changes, in
eia_router.py:_widget_configtakesnewest_page. When it's set, the widget getslimit5000 and a hiddensortofdesc, so it opens on the newest 5,000 rows._NEWEST_PAGE, and the four flat commands (AEO, IEO, International, SEDS) passnewest_page=True.limitstaysNone(full pagination) andsortstaysasc. The widget'slimitstays visible, so a user can raise it or add filters.Tests
New
tests/test_widget_newest_page.py, which reads the app's OpenAPI:limit5000 and hiddensortdescinwidget_config;limit=None,sort="asc".The first test fails without the change; with it, all three pass. The provider suite passes: 2,097 tests (Python 3.12).
Results from a deployment
We run this as an overlay on the 2.0.0 wheel in OpenBQ's Docker image. Before the change, a sweep of every widget at its defaults got the "too broad" refusal above on these 25 widgets. Our overlay test checks the same 25 widget defaults through
openbb-platform-api'swidgets.jsonbuilder, and that the other 194 EIA widgets are unchanged.Not included
The list is static. If EIA grows another dataset past the ceiling, its widget needs adding.
🤖 Generated with Claude Code