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

EmptyDataError from SomaHoldings.get_summary: the SOMA weekly summary endpoint responded but soma.summary was empty. Unlike 374/375 this is EmptyDataError — OpenBB treats it as 'no results for the query' even though the wording says 'error with the request'.

Source

Thrown at openbb_platform/providers/federal_reserve/openbb_federal_reserve/utils/ny_fed_api.py:413

        return release_log

    async def get_summary(self) -> list[dict]:
        """Return historical weekly summary by holding type.

        Returns
        -------
        List[Dict]: Historical weekly summary by holding type.

        Example
        -------
        summary = await SomaHoldings().get_summary()
        """
        url = _get_endpoints()["soma_holdings"]["summary"]
        response = await fetch_data(url)
        summary = response.get("soma", {}).get("summary", [])
        if not summary:
            raise EmptyDataError(
                "There was an error with the request and was returned empty."
            )

        return summary

    async def get_agency_holdings(
        self,
        as_of: str | None = None,
        cusip: str | None = None,
        holding_type: str | None = None,
        wam: bool = False,
    ) -> list[dict]:
        """Get the latest agency holdings, or as of a single date. Data is updated weekly.

        Parameters
        ----------
        as_of: Optional[str]
            The as-of date to get data for. Defaults to the latest.

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Retry once after a short backoff — many empty responses are transient.
  2. Verify the endpoint payload manually; if the key was renamed, update the provider.
  3. Catch EmptyDataError and fall back to your last cached summary.

Example fix

try:
    summary = await SomaHoldings().get_summary()
except EmptyDataError:
    summary = load_cached_summary()  # degrade gracefully
    if summary is None:
        raise
Defensive patterns

Strategy: fallback

Try / catch

from openbb_core.provider.standard_errors import EmptyDataError
try:
    summary = await SomaHoldings().get_summary()
except EmptyDataError:
    summary = cache.get('soma_summary')
    if summary is None:
        raise

Prevention

When it happens

Trigger: Calling get_summary() (weekly holdings summary by type) when the NY Fed returns an empty summary array — service hiccup, schema change, or endpoint temporarily unpublished.

Common situations: Long-running dashboards polling SOMA summary; upstream schema renames of the 'summary' key; intermittent empty responses.

Related errors


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