OpenBB-finance/OpenBB · warning · EmptyDataError

No results found. Try adjusting the query parameters.

Error message

No results found. Try adjusting the query parameters.

What it means

Raised as EmptyDataError by FederalReserveOvernightBankFundingRateFetcher.aextract_data when the NY Fed API (/api/rates/unsecured/obfr/search.json) returns no 'refRates' for the requested date range. Same pattern as the EFFR fetcher: an empty upstream response is converted to the standard no-results error.

Source

Thrown at openbb_platform/providers/federal_reserve/openbb_federal_reserve/models/overnight_bank_funding_rate.py:105

    async def aextract_data(
        query: FederalReserveOvernightBankFundingRateQueryParams,
        credentials: dict[str, str] | None,
        **kwargs: Any,
    ) -> list[dict]:
        """Extract the raw data."""
        # pylint: disable=import-outside-toplevel
        from openbb_core.provider.utils.helpers import amake_request

        url = (
            "https://markets.newyorkfed.org/api/rates/unsecured/obfr/search.json?"
            + f"startDate={query.start_date}&endDate={query.end_date}"
        )
        results: list[dict] = []
        response = await amake_request(url, **kwargs)
        if response.get("refRates", []):  # type: ignore
            results = response["refRates"]  # type: ignore
        if not results:
            raise EmptyDataError()
        return results

    @staticmethod
    def transform_data(
        query: FederalReserveOvernightBankFundingRateQueryParams,
        data: list[dict],
        **kwargs: Any,
    ) -> list[FederalReserveOvernightBankFundingRateData]:
        """Transform data."""
        results: list[FederalReserveOvernightBankFundingRateData] = []
        for d in data.copy():
            _ = d.pop("type", None)
            _ = d.pop("revisionIndicator", None)
            _ = d.pop("footnoteId", None)
            results.append(FederalReserveOvernightBankFundingRateData.model_validate(d))

        return sorted(results, key=lambda x: x.date)

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Adjust the date range to covered business days (OBFR data starts around 2016).
  2. Hit the NY Fed API URL directly to confirm whether refRates is empty for those dates.
  3. Catch EmptyDataError and treat as zero rows in batch jobs.
Defensive patterns

Strategy: try-catch

Validate before calling

from datetime import date
start = max(start_date, date(2016, 4, 4))  # OBFR coverage begins April 2016
if start > end_date:
    raise EmptyDataError('range predates OBFR coverage')

Try / catch

from openbb_core.provider.standard_errors import EmptyDataError
try:
    res = obb.economy.fed.overnight_bank_funding_rate(start_date=start, end_date=end)
except EmptyDataError:
    res = None

Prevention

When it happens

Trigger: Querying OBFR with dates before its publication start (~2016), a future range, or a range too narrow to include a business day.

Common situations: Reusing EFFR-style long history ranges that predate OBFR; weekend-only ranges; mistyped date parameters.

Related errors


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