OpenBB-finance/OpenBB · warning · EmptyDataError
There was an error with the request and it was returned empt
Error message
There was an error with the request and it was returned empty.
What it means
Raised in FredSeniorLoanOfficerSurveyFetcher.transform_data (openbb_fred/models/senior_loan_officer_survey.py:129) when the wrapped FredSeriesFetcher result contains no data rows (or all rows are NaN and dropped). The survey data arrives as a wide date-by-series DataFrame; if the upstream series request came back without observations (rate limiting, invalid IDs, out-of-range dates) the DataFrame is empty and this EmptyDataError fires.
Source
Thrown at openbb_platform/providers/fred/openbb_fred/models/senior_loan_officer_survey.py:129
return {
"metadata": response.metadata,
"data": [d.model_dump() for d in response.result],
}
@staticmethod
def transform_data(
query: FredSeniorLoanOfficerSurveyQueryParams,
data: dict,
**kwargs: Any,
) -> AnnotatedResult[list[FredSeniorLoanOfficerSurveyData]]:
"""Transform data."""
# pylint: disable=import-outside-toplevel
from pandas import DataFrame
metadata = data.get("metadata", {})
df = DataFrame(data.get("data", [])).dropna()
if df.empty:
raise EmptyDataError(
"There was an error with the request and it was returned empty."
)
# Flatten data
df = df.melt(id_vars="date", var_name="symbol", value_name="value").query(
"value.notnull()"
)
df["title"] = df.symbol.apply(lambda x: metadata[x].get("title", ""))
df["value"] = df["value"].astype(float) / 100
df = df.fillna("N/A").replace("N/A", None)
records = df.sort_values(by="date").to_dict(orient="records")
return AnnotatedResult(
result=[FredSeniorLoanOfficerSurveyData.model_validate(d) for d in records],
metadata=metadata,
)
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Retry after 60 seconds to rule out rate limiting.
- Clear or widen start_date/end_date to include published quarters.
- Confirm the underlying series (e.g. DRTSCILM) still resolves via fred_series.
Defensive patterns
Strategy: retry
Try / catch
from openbb_core.provider.utils.errors import EmptyDataError
import time
try:
res = obb.economy.fred.senior_loan_officer_survey(start_date=s, end_date=e)
except EmptyDataError:
time.sleep(60) # likely rate limited
res = obb.economy.fred.senior_loan_officer_survey() # retry unfiltered Prevention
- Space out multi-endpoint FRED jobs or cache survey output (quarterly data changes slowly).
- Align date ranges with the quarterly publication calendar.
When it happens
Trigger: Calling economy/fred senior-loan-officer-survey while the FRED key is rate limited; a date range outside the survey's quarterly publication window; FRED temporarily missing the survey series.
Common situations: Backtesting jobs that call many FRED endpoints in a loop and trip the 50-req/min cap mid-batch; requesting future quarters.
Related errors
- No data found for the item and region combination. You may a
- The request was returned empty.
- There was an error with the request and was returned empty.
- There was an error with the request and was returned empty.
- The request was returned empty.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/9b54c1f577784807.
Report an issue: GitHub.