OpenBB-finance/OpenBB · warning · EmptyDataError

The request was returned empty with no error messages.

Error message

The request was returned empty with no error messages.

What it means

Raised by the EIA Short-Term Energy Outlook extract when every request completed without raising yet the results list is empty and no warning messages were collected — i.e. the API accepted the requests but returned no data records and no explanatory error fields. EmptyDataError (not OpenBBError), so the framework treats it as 'no data available' rather than a failure.

Source

Thrown at openbb_platform/providers/eia/openbb_us_eia/models/short_term_energy_outlook.py:222

                            res.get("request", {}).get("params", {}).get("facets", {}).get("seriesId", [])  # type: ignore
                        )
                        masked_url = url.replace(api_key, "API_KEY")
                        messages.append(
                            f"No additional data returned for {series_id or masked_url}"
                        )
                    if additional_data:
                        results.extend(additional_data)
                    n_results += len(additional_data)
                    url = url.replace(f"&offset={offset}", f"&offset={offset + 5000}")
                    offset += 5000

        try:
            await asyncio.gather(*[get_one(url) for url in urls])
        except Exception as e:
            raise OpenBBError(f"Error fetching data from the EIA API -> {e}") from e

        if not results and not messages:
            raise EmptyDataError(
                "The request was returned empty with no error messages."
            )
        if not results and messages:
            raise OpenBBError("\n".join(messages))
        if results and messages:
            warn("\n".join(messages))

        return results

    @staticmethod
    def transform_data(
        query: EiaShortTermEnergyOutlookQueryParams,
        data: list[dict],
        **kwargs: Any,
    ) -> list[EiaShortTermEnergyOutlookData]:
        """Transform the data."""
        # pylint: disable=import-outside-toplevel
        from pandas import Categorical, DataFrame, to_datetime

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Verify the series/facet combination exists in EIA's STEO API and currently has published data.
  2. Loosen or remove restrictive query filters (dates) and retry.
  3. Treat EmptyDataError as 'no data' in caller logic rather than retrying blindly.
  4. Update the provider package — series mappings are maintained there.
Defensive patterns

Strategy: fallback

Try / catch

from openbb_core.provider.abstract.fetcher import EmptyDataError

try:
    res = await obb.energy.short_term_energy_outlook(provider='eia')
except EmptyDataError:
    logger.info('EIA STEO returned no rows for this query — skipping')
    res = None

Prevention

When it happens

Trigger: Valid API call whose series_id set returns empty response data (discontinued series, future-dated projections outside range); empty responses parsed to zero records without triggering the no-additional-data message path.

Common situations: Querying discontinued or renamed EIA series IDs; date/parameter combos with no published rows yet; API behavior changes returning empty data arrays instead of errors.

Related errors


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