OpenBB-finance/OpenBB · warning · EmptyDataError

No data was found for the supplied date range and countries.

Error message

No data was found for the supplied date range and countries.

What it means

EmptyDataError from EconDbGdpRealFetcher.transform_data: rows were fetched successfully but the start_date/end_date filter reduced the DataFrame to zero rows. Purely a date-window mismatch — the data exists outside the requested range.

Source

Thrown at openbb_platform/providers/econdb/openbb_econdb/models/gdp_real.py:204

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

        df = DataFrame(data)

        if query.start_date:
            df = df[to_datetime(df["date"]) >= to_datetime(query.start_date)]
        if query.end_date:
            df = df[to_datetime(df["date"]) <= to_datetime(query.end_date)]

        if df.empty:  # type: ignore
            raise EmptyDataError(
                "No data was found for the supplied date range and countries."
            )

        df = df.set_index(["date", "country"])  # type: ignore
        df = df.dropna()
        df["value"] = (df["value"] * 1_000_000_000).astype("int64")
        df["real_growth_qoq"] = df["real_growth_qoq"] / 100
        df["real_growth_yoy"] = df["real_growth_yoy"] / 100
        df = df.reset_index()
        df = df.sort_values(by=["date", "value"], ascending=[True, False])

        return [
            EconDbGdpRealData.model_validate(d) for d in df.to_dict(orient="records")
        ]

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Query without dates first to learn the series' actual coverage.
  2. Align start_date/end_date to quarter boundaries of available data.
  3. Lag end_date back one or two quarters for freshly released periods.

Example fix

# before
obb.economy.gdp_real(provider='econdb', country='us', start_date='2026-08-01', end_date='2026-08-31')  # between quarterly points / unpublished

# after
obb.economy.gdp_real(provider='econdb', country='us', start_date='2024-01-01')  # window with published quarters
Defensive patterns

Strategy: validation

Validate before calling

full = obb.economy.gdp_real(provider='econdb', country='us').to_df()
lo, hi = full['date'].min(), full['date'].max()
start_date = max(start_date, lo)
end_date = min(end_date, hi)

Try / catch

from openbb_core.provider.utils.errors import EmptyDataError
try:
    res = obb.economy.gdp_real(provider='econdb', country='us', start_date=start_date)
except EmptyDataError:
    res = obb.economy.gdp_real(provider='econdb', country='us')
    df = res.to_df(); df = df[df['date'] >= start_date]

Prevention

When it happens

Trigger: economy.gdp_real(provider='econdb', start_date/end_date) covering a period with no observations: dates before the series start, dates after the last published quarter, or a narrow window between quarterly observations.

Common situations: Sentinel start dates ('1900-01-01'); expecting current-quarter data that is not yet released; quarterly granularity missing a daily-precision window.

Related errors


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