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 FredTipsYieldsFetcher.transform_data (openbb_fred/models/tips_yields.py:243) when the 'records' list handed from extract_data is empty. By this point the TIPS ID list was fetched and the series data retrieved, so an empty records list means the melt/filtering of observations produced nothing - typically every observation was NaN or the maturity filter removed all series. An EmptyDataError.

Source

Thrown at openbb_platform/providers/fred/openbb_fred/models/tips_yields.py:243

        records = df.to_dict(orient="records")
        output = {
            "records": records,
            "meta": meta,
        }

        return output

    @staticmethod
    def transform_data(
        query: FredTipsYieldsQueryParams,
        data: dict,
        **kwargs: Any,
    ) -> AnnotatedResult[list[FredTipsYieldsData]]:
        """Transform the data."""
        results = data.get("records", [])
        meta = data.get("meta", {})
        if not results:
            raise EmptyDataError(
                "There was an error with the request and was returned empty."
            )

        return AnnotatedResult(
            result=[FredTipsYieldsData.model_validate(r) for r in results],
            metadata=meta,
        )

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Use a real TIPS tenor: 5, 10, 20, or 30.
  2. Drop the maturity filter to fetch all tenors, then slice locally.
  3. Clear date filters and retry.

Example fix

# before - TIPS are not issued at 7y
obb.economy.fred.tips_yields(maturity=7)

# after
obb.economy.fred.tips_yields(maturity=10)
Defensive patterns

Strategy: validation

Validate before calling

VALID_TIPS_TENORS = {5, 10, 20, 30}

if maturity is not None and int(maturity) not in VALID_TIPS_TENORS:
    maturity = min(VALID_TIPS_TENORS, key=lambda t: abs(t - maturity))  # snap to nearest issued tenor

Type guard

def is_issued_tips_tenor(m: object) -> bool:
    """True when m is one of the TIPS maturities FRED publishes (5, 10, 20, 30 years)."""
    return isinstance(m, (int, float)) and not isinstance(m, bool) and int(m) in {5, 10, 20, 30}

Try / catch

from openbb_core.provider.utils.errors import EmptyDataError

try:
    res = obb.economy.fred.tips_yields(maturity=maturity)
except EmptyDataError:
    res = obb.economy.fred.tips_yields()  # all tenors; slice locally

Prevention

When it happens

Trigger: Passing a maturity value that matches no TIPS series (e.g. maturity=7, which TIPS do not come in - tenors are 5/10/20/30); all observations null in the requested window.

Common situations: Assuming any integer maturity exists; combining maturity filters with date ranges that exclude all observations.

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/087ef843cdcf7039. Report an issue: GitHub.