OpenBB-finance/OpenBB · error · EmptyDataError
The data is empty.
Error message
The data is empty.
What it means
Raised inside the EIA Petroleum Status Report transform stage when all requested tables produced no parseable rows, so the concatenated result is empty. EmptyDataError signals 'valid request, no data' — commonly the chosen tables have no rows in the downloaded workbook or the category's file layout changed and parsing found nothing.
Source
Thrown at openbb_platform/providers/eia/openbb_us_eia/models/petroleum_status_report.py:230
df = df[df.date <= query.end_date]
df = df.reset_index(drop=True)
if len(df) > 0:
dfs.append(df)
else:
warn(f"No data for table: {table}")
try:
with concurrent.futures.ThreadPoolExecutor() as executor:
executor.map(
lambda table: read_excel_file(file, category, table), tables
)
results = concat(dfs)
if len(results) < 1:
raise EmptyDataError("The data is empty.")
results = results.sort_values(by=["date", "table", "order"]).replace(
{nan: None}
)
return [
EiaPetroleumStatusReportData.model_validate(d)
for d in results.to_dict(orient="records")
]
except Exception as e: # pylint: disable=broad-except
raise OpenBBError(f"Error transforming the data -> {e}") from e
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Try the default tables (e.g. 'stocks' for weekly_estimates) to confirm the file itself parses.
- Retry with use_cache=False — a stale cached workbook from a broken download can persist via the alru_cache.
- Update the openbb-us-eia provider package; parsing fixes for new workbook layouts land there.
- Inspect the downloaded ExcelFile manually (sheet_names, first rows) for the requested tables.
Defensive patterns
Strategy: fallback
Try / catch
from openbb_core.provider.abstract.fetcher import EmptyDataError
try:
res = await obb.energy.petroleum_status_report(category=cat, table=tbl, provider='eia')
except EmptyDataError:
logger.info('No rows for %s/%s — trying default tables', cat, tbl)
res = await obb.energy.petroleum_status_report(category=cat, provider='eia', use_cache=False) Prevention
- Handle EmptyDataError as 'no data', not as a crash
- Retry once with use_cache=False to rule out stale cache
- Prefer default tables when iterating over many categories
When it happens
Trigger: All table parsers warned 'No data for table: X' leaving dfs empty; requesting tables for a week where the report file exists but those sections are blank; pandas/openpyxl version drift breaking sheet parsing so nothing is read.
Common situations: Asking for niche tables that are intermittently empty in the report; EIA changing workbook sheet names; date/week parameter combinations for which the report has no data.
Related errors
- Error transforming the data -> {e}
- 'all' is not a supported choice for {category}. Please choos
- Invalid table choice: {table}. Valid choices for {category}:
- Error extracting data -> {e}
- Expected an ExcelFile object, got {type(file)} instead.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/5d2815bcc023d055.
Report an issue: GitHub.