OpenBB-finance/OpenBB · error · OpenBBError

No data was returned.

Error message

No data was returned.

What it means

Raised inside the ECB yield-curve fetcher's per-maturity task when the response from data.ecb.europa.eu/data-detail-api/{series_id} is falsy (None, empty list, or empty dict). Each of the ~30+ maturity series is fetched independently, so one dead/empty series fails the whole asyncio.gather call.

Source

Thrown at openbb_platform/providers/ecb/openbb_ecb/models/yield_curve.py:106

            if use_cache is True:
                cache_dir = f"{get_user_cache_directory()}/http/ecb_yield_curve"
                async with CachedSession(
                    cache=SQLiteBackend(cache_dir, expire_after=3600 * 4)
                ) as session:
                    await session.delete_expired_responses()
                    try:
                        response = await amake_request(
                            url,
                            session=session,  # type: ignore
                        )
                    finally:
                        await session.close()
            else:
                response = await amake_request(url=url)

            if not response:
                raise OpenBBError("No data was returned.")

            if isinstance(response, list):
                for item in response:
                    d = {
                        "date": item.get("PERIOD"),
                        "maturity": maturity,
                        "rate": item.get("OBS_VALUE_AS_IS"),
                    }
                    results.append(d)

        tasks = [get_one(maturity, query.use_cache) for maturity in MATURITIES]

        await asyncio.gather(*tasks)

        return results

    @staticmethod
    def transform_data(

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Retry with use_cache=False to rule out a cached empty response: obb.fixedincome.government_yield_curve(provider='ecb', use_cache=False).
  2. Update the openbb-ecb provider (pip install -U openbb-ecb) so yield_curve_series ids match the current ECB series.
  3. Clear the cache directory (<user_cache>/http/ecb_yield_curve) if old empty responses persist.
  4. Fall back to another provider for yield curves if ECB is mid-incident.

Example fix

# before
data = obb.fixedincome.government_yield_curve(provider="ecb")  # one empty series kills all

# after
data = obb.fixedincome.government_yield_curve(provider="ecb", use_cache=False)
Defensive patterns

Strategy: retry

Validate before calling

import requests

def maturity_series_ok(series_id: str) -> bool:
    r = requests.get(f"https://data.ecb.europa.eu/data-detail-api/{series_id}", timeout=10)
    return r.status_code == 200 and bool(r.json())

Try / catch

from openbb_core.provider.utils.errors import OpenBBError
try:
    curve = obb.fixedincome.government_yield_curve(provider="ecb")
except OpenBBError as e:
    if "No data was returned" in str(e):
        curve = obb.fixedincome.government_yield_curve(provider="ecb", use_cache=False)  # retry fresh
    else:
        raise

Prevention

When it happens

Trigger: Calling obb.fixedincome.government_yield_curve(provider="ecb", ...).get() when any single maturity series id returns an empty body — commonly a discontinued series (ECB occasionally re-baskets series), or a cached empty response replayed by aiohttp_client_cache when use_cache=True.

Common situations: ECB retires/renames a series id in yield_curve_series.py after the provider release; stale SQLite HTTP cache containing an empty 200 response; transient empty responses during ECB maintenance windows.

Related errors


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