OpenBB-finance/OpenBB · warning · EmptyDataError
There was an error with the request and was returned empty.
Error message
There was an error with the request and was returned empty.
What it means
Raised in FredSurveyOfEconomicConditionsChicagoFetcher.transform_data (openbb_fred/models/survey_of_economic_conditions_chicago.py:136) when the DataFrame built from the extracted records is empty. The survey's series are fetched via FredSeriesFetcher and reshaped wide; an empty frame means the upstream series request returned no observations. An EmptyDataError, usually caused by rate limiting or date ranges outside the survey's coverage.
Source
Thrown at openbb_platform/providers/fred/openbb_fred/models/survey_of_economic_conditions_chicago.py:136
return {
"metadata": response.metadata,
"data": [d.model_dump() for d in response.result],
}
@staticmethod
def transform_data(
query: FredSurveyOfEconomicConditionsChicagoQueryParams,
data: dict,
**kwargs: Any
) -> AnnotatedResult[list[FredSurveyOfEconomicConditionsChicagoData]]:
"""Transform data."""
# pylint: disable=import-outside-toplevel
from pandas import DataFrame
df = DataFrame(data["data"])
metadata = data.get("metadata", {})
if df.empty:
raise EmptyDataError(
"There was an error with the request and was returned empty."
)
df = df.set_index("date").sort_index()
df.columns = [ID_TO_FIELD.get(c, c) for c in df.columns]
if query.transform in ["pch", "pc1", "pca", "cch", "cca"]:
df = df / 100
df = df.reset_index().fillna("N/A").replace("N/A", None)
records = df.to_dict(orient="records")
return AnnotatedResult(
result=[
FredSurveyOfEconomicConditionsChicagoData.model_validate(d)
for d in records
],
metadata=metadata,
)
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Retry after 60 seconds (rate limiting).
- Widen or clear the date range.
- Verify the underlying series resolve via fred_series (e.g. the NFMFC/SA news diffusion indices).
Defensive patterns
Strategy: retry
Try / catch
from openbb_core.provider.utils.errors import EmptyDataError
try:
res = obb.economy.fred.survey_of_economic_conditions_chicago(start_date=s, end_date=e)
except EmptyDataError:
res = obb.economy.fred.survey_of_economic_conditions_chicago() # full history Prevention
- The survey publishes on a fixed cadence - align requested windows with it.
- Cache results; survey data is low-frequency and rarely changes intra-period.
When it happens
Trigger: Calling economy/fred survey-of-economic-conditions-chicago while rate limited; start_date/end_date excluding all published observations; the Chicago Fed survey series being unavailable upstream.
Common situations: Scheduled jobs bundling many FRED calls and hitting the per-minute cap; requesting recent months before the survey publishes.
Related errors
- There was an error with the request and it was returned empt
- The request was returned with no data.
- No data was found for, {query.country}.
- The request was returned empty.
- No data found for the given query. Try adjusting the paramet
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/7a44a29a36338c5f.
Report an issue: GitHub.