OpenBB-finance/OpenBB · warning · EmptyDataError
Error: The no data was found for the supplied symbols and co
Error message
Error: The no data was found for the supplied symbols and countries: {query.symbol.split(',')} {query.country.split(',') if query.country else ''} What it means
EmptyDataError from EconDbEconomicIndicatorsFetcher.transform_data: raw records arrived, but after per-symbol cleaning, transformation alignment and dropna, the combined `output` DataFrame is empty. The message embeds the requested symbols and countries (as Python lists, due to f-string of .split(',')).
Source
Thrown at openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py:476
].sort_values(
by="date"
)
result["symbol_root"] = indicator
result["symbol"] = _symbol
result["country"] = country
# We can normalize the percent values here
# because we have accounted for transformation, if done.
if units == "PERCENT" or scale == "PERCENT":
result["value"] = result["value"].astype(float).div(100)
# Combine it with all the other series requested.
output = concat([output, result.dropna()], axis=0)
output = (
output.set_index(["date", "symbol_root", "country"])
.sort_index()
.reset_index()
)
if output.empty:
raise EmptyDataError(
"Error: The no data was found for the supplied symbols and countries: "
+ f"{query.symbol.split(',')} {query.country.split(',') if query.country else ''}"
)
records = (
output.fillna("N/A")
.replace("N/A", None)
.replace("nan", None)
.replace("", None)
.replace(0, None)
.to_dict("records")
)
return AnnotatedResult(
result=[
EconDbEconomicIndicatorsData.model_validate(r)
for r in records
if r["value"] is not None
],
metadata=metadata,View on GitHub (pinned to 3e071fcc2c)
Solutions
- Widen the date range well beyond the transformation lag (e.g. +1 extra year for YoY).
- Retry without the '~transform' suffix to confirm raw levels exist for the window.
- Query each symbol separately to isolate which one collapses to empty after dropna.
- Treat EmptyDataError as 'no observations' and continue in batch jobs.
Example fix
# before res = obb.economy.indicator(provider="econdb", symbol="cpi~yoy", country="us", start_date="2024-01-01", end_date="2024-03-01") # YoY lag -> all NaN # after res = obb.economy.indicator(provider="econdb", symbol="cpi~yoy", country="us", start_date="2022-01-01", end_date="2024-03-01")
Defensive patterns
Strategy: validation
Validate before calling
TRANSFORM_LAG_YEARS = {"yoy": 1, "ytd": 1} # conservative
def range_covers_transform(start, end, transform: str | None) -> bool:
lag = TRANSFORM_LAG_YEARS.get((transform or "").lower(), 0)
return (end.year - start.year) >= lag Try / catch
from openbb_core.provider.utils.errors import EmptyDataError
try:
res = obb.economy.indicator(provider="econdb", symbol=s, country=c, start_date=a, end_date=b).to_df()
except EmptyDataError:
if "~" in s: # transform likely ate the window
res = obb.economy.indicator(provider="econdb", symbol=s.split("~")[0], country=c, start_date=a, end_date=b).to_df()
else:
raise Prevention
- Pad start_date by one extra year when using '~' transforms (YoY needs prior-year levels).
- Confirm raw levels exist for the window before blaming coverage.
- Request symbols individually to isolate the one that drops to all-NaN.
When it happens
Trigger: Calling obb.economy.indicator(provider='econdb', ...) where every fetched series drops to all-NaN — e.g. transform suffixes that produce NaN over the whole window, dates misaligned so dropna removes all rows, or symbols whose observations are all null in the requested period.
Common situations: Year-over-year transforms requested over a window shorter than the transform lag; querying a period before the series started (rows exist in raw payload but are null); mixing symbols whose data ended with ones that haven't started.
Related errors
- No data found for the provided dates. Data has a range from
- "\n".join(messages) # messages contain e.g. 'No data was re
- No data was found for the country, {query.country}, and date
- There was an error fetching the data.
- The request returned empty.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/547942a4bba6c315.
Report an issue: GitHub.