OpenBB-finance/OpenBB · error · EmptyDataError
No data found for the given query. Try adjusting the paramet
Error message
No data found for the given query. Try adjusting the parameters.
What it means
Error "No data found for the given query. Try adjusting the parameters." thrown in OpenBB-finance/OpenBB.
Source
Thrown at openbb_platform/providers/fred/openbb_fred/models/consumer_price_index.py:125
results["data"] = [
{country_map.get(k, k): v for k, v in d.items()} for d in result
]
return results
@staticmethod
def transform_data(
query: FREDConsumerPriceIndexQueryParams,
data: dict,
**kwargs: Any,
) -> AnnotatedResult[list[FREDConsumerPriceIndexData]]:
"""Transform data and validate the model."""
# pylint: disable=import-outside-toplevel
from pandas import DataFrame
df = DataFrame.from_records(data["data"])
if df.empty:
raise EmptyDataError(
"No data found for the given query. Try adjusting the parameters."
)
# Flatten the data as a pivot table.
df = (
df.melt(id_vars="date", var_name="country", value_name="value")
.query("value.notnull()")
.set_index(["date", "country"])
.sort_index()
.reset_index()
)
# Normalize the percent values.
if query.transform in ("period", "yoy"):
df["value"] = df["value"] / 100
records = df.to_dict(orient="records")
metadata = data.get("metadata", {})
return AnnotatedResult(
result=[FREDConsumerPriceIndexData.model_validate(r) for r in records],View on GitHub (pinned to 3e071fcc2c)
Solutions
- Adjust the parameters: widen the date range or change country/transform.
- Verify the selected country and frequency combination has published CPI data.
- Retry later in case of FRED rate limiting.
When it happens
Trigger: Thrown at openbb_platform/providers/fred/openbb_fred/models/consumer_price_index.py:125 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/5697d4d251afab8a.
Report an issue: GitHub.