{"record":{"id":"c55b1a0cdbc6006f","repo":"OpenBB-finance/OpenBB","slug":"no-results-found-try-adjusting-the-query-paramete-c55b1a","errorCode":null,"errorMessage":"No results found. Try adjusting the query parameters.","messagePattern":"No results found\\. Try adjusting the query parameters\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/federal_reserve/openbb_federal_reserve/models/sofr.py","lineNumber":91,"sourceCode":"    @staticmethod\n    async def aextract_data(\n        query: FederalReserveSOFRQueryParams,\n        credentials: dict[str, str] | None,\n        **kwargs: Any,\n    ) -> list[dict]:\n        \"\"\"Extract the raw data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from openbb_core.provider.utils.helpers import amake_request\n\n        url = (\n            \"https://markets.newyorkfed.org/api/rates/secured/sofr/search.json?\"\n            + f\"startDate={query.start_date}&endDate={query.end_date}\"\n        )\n        results: list[dict] = []\n        response = await amake_request(url, **kwargs)\n        results = response.get(\"refRates\")  # type: ignore\n        if not results:\n            raise EmptyDataError()\n        return results\n\n    @staticmethod\n    def transform_data(\n        query: FederalReserveSOFRQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> list[FederalReserveSOFRData]:\n        \"\"\"Transform data.\"\"\"\n        results: list[FederalReserveSOFRData] = []\n        for d in data.copy():\n            _ = d.pop(\"type\", None)\n            _ = d.pop(\"footnoteId\", None)\n            _ = d.pop(\"revisionIndicator\", None)\n            results.append(FederalReserveSOFRData.model_validate(d))\n\n        return sorted(results, key=lambda x: x.date)\n","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/federal_reserve/openbb_federal_reserve/models/sofr.py#L73-L109","documentation":"Raised in FederalReserveSOFRFetch.extract_data when the NY Fed secured-rates search endpoint returns a payload whose 'refRates' key is missing, null, or an empty list. EmptyDataError is OpenBB's standard signal that the query is valid but no rows matched, so the framework reports 'No results found' instead of a stack trace.","triggerScenarios":"Calling obb.fixedincome.rate.sofr(provider='federal_reserve') with a start_date/end_date range containing no SOFR fixings (weekends, future dates, pre-2018 dates), or when markets.newyorkfed.org returns an error body without 'refRates'.","commonSituations":"end_date in the future (API returns nothing past latest fixing); inverted or too-narrow date range; NY Fed API downtime returning 200 with an error JSON.","solutions":["Set start_date/end_date to business days within the SOFR publication window (2018-04 onward to present).","Test the URL https://markets.newyorkfed.org/api/rates/secured/sofr/search.json?startDate=...&endDate=... directly to confirm data exists.","Handle EmptyDataError as an empty result in the caller."],"exampleFix":"try:\n    data = await obb.fixedincome.rate.sofr(provider='federal_reserve', start_date='2024-01-02', end_date='2024-01-31').to_df()\nexcept EmptyDataError:\n    data = pd.DataFrame()","handlingStrategy":"validation","validationCode":"from datetime import date\nstart = date(2024, 1, 2); end = date(2024, 1, 31)\nassert start.weekday() < 5 and end.weekday() < 5 and start < end and start >= date(2018, 4, 2)","typeGuard":null,"tryCatchPattern":"try:\n    data = await obb.fixedincome.rate.sofr(provider='federal_reserve', start_date=start, end_date=end)\nexcept EmptyDataError:\n    data = None","preventionTips":["Use business days within SOFR's publication window (2018-04 onward)","Never set end_date in the future expecting latest data"],"tags":["openbb","sofr","ny-fed","empty-data"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}