OpenBB-finance/OpenBB · warning · EmptyDataError

The request was returned empty.

Error message

The request was returned empty.

What it means

EmptyDataError raised in IntrinioEquityHistoricalFetcher.transform_data when the raw data list is empty after fetch. The API call succeeded (no error key) but returned zero bars for the symbol/parameters, so there is nothing to sort on the date/time column or validate into IntrinioEquityHistoricalData.

Source

Thrown at openbb_platform/providers/intrinio/openbb_intrinio/models/equity_historical.py:265

                all_data.extend(response_data.get(data_key, []))  # type: ignore
                next_page = response_data.get("next_page", None)  # type: ignore

            return all_data

        url = f"{base_url}&{query_str}&api_key={api_key}"

        return await amake_request(url, response_callback=callback, **kwargs)  # type: ignore

    @staticmethod
    def transform_data(
        query: IntrinioEquityHistoricalQueryParams,
        data: list[dict],
        **kwargs: Any,
    ) -> list[IntrinioEquityHistoricalData]:
        """Return the transformed data."""
        if not data:
            raise EmptyDataError("The request was returned empty.")
        date_col = (
            "time"
            if query.interval in ["1m", "5m", "10m", "15m", "30m", "60m", "1h"]
            else "date"
        )
        return [
            IntrinioEquityHistoricalData.model_validate(d)
            for d in sorted(data, key=lambda x: x[date_col], reverse=False)
        ]

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Set start_date/end_date to a window where the security actually traded
  2. Verify listing dates for the symbol and clamp your request range
  3. Catch EmptyDataError and skip/continue in batch loops — it is a normal 'no rows' outcome, not a bug

Example fix

# before
df = obb.equity.price.historical(provider="intrinio", symbol="TSLA", start_date="1999-01-01", end_date="1999-02-01").to_df()

# after
df = obb.equity.price.historical(provider="intrinio", symbol="TSLA", start_date="2024-01-01", end_date="2024-02-01").to_df()
Defensive patterns

Strategy: try-catch

Validate before calling

from datetime import datetime, timedelta

def plausible_date_range(symbol_listed: datetime, start: str, end: str) -> bool:
    s, e = datetime.fromisoformat(start), datetime.fromisoformat(end)
    return s < e and s >= symbol_listed and e <= datetime.now() + timedelta(days=1)

Type guard

from openbb_core.provider.utils.errors import EmptyDataError

Try / catch

from openbb_core.provider.utils.errors import EmptyDataError

try:
    bars = await obb.equity.price.historical(provider="intrinio", symbol=sym, start_date=s, end_date=e)
except EmptyDataError:
    bars = []  # no rows in window — expected outcome

Prevention

When it happens

Trigger: Valid symbol with no price rows in the requested window (date range before listing, weekend-only range for daily bars, or a range with no trading data); a frequency/interval combination that yields no rows; thinly traded securities.

Common situations: Backtesting scripts looping over date windows that run past a ticker's listing date; requesting daily bars for a window entirely on weekends/holidays; using a newly listed ticker with an old start_date.

Related errors


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