{"record":{"id":"ef37f6941e40455e","repo":"OpenBB-finance/OpenBB","slug":"the-request-was-returned-with-no-data","errorCode":null,"errorMessage":"The request was returned with no data.","messagePattern":"The request was returned with no data\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/fred/openbb_fred/models/ameribor.py","lineNumber":163,"sourceCode":"            raise e from e\n\n        return {\n            \"metadata\": response.metadata,  # type: ignore\n            \"data\": [d.model_dump() for d in response.result],  # type: ignore\n        }\n\n    @staticmethod\n    def transform_data(\n        query: FredAmeriborQueryParams,\n        data: dict,\n        **kwargs: Any,\n    ) -> AnnotatedResult[list[FredAmeriborData]]:\n        \"\"\"Transform data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from pandas import Categorical, DataFrame\n\n        if not data[\"data\"]:\n            raise EmptyDataError(\"The request was returned with no data.\")\n        metadata = data.get(\"metadata\", {})\n        maturity_dict = {\n            \"AMERIBOR\": \"overnight\",\n            \"AMBOR30\": \"day_30\",\n            \"AMBOR90\": \"day_90\",\n            \"AMBOR30T\": \"day_30\",\n            \"AMBOR90T\": \"day_90\",\n        }\n\n        df = DataFrame(data.get(\"data\", []))\n        # Flatten data\n        df = df.melt(id_vars=\"date\", var_name=\"symbol\", value_name=\"value\").query(\n            \"value.notnull()\"\n        )\n        df = df.rename(columns={\"value\": \"rate\"}).sort_values(by=\"date\")\n        # Normalize percent values\n        df[\"rate\"] = df[\"rate\"].astype(float) / 100\n","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fred/openbb_fred/models/ameribor.py#L145-L181","documentation":"Raised by FredAmeriborFetch.transform_data when data['data'] is falsy - the FRED series fetch returned a payload whose 'data' mapping (date -> AMERIBOR rates) is empty, so there is nothing to melt into observations. The check happens before the pandas melt/pivot that builds the AnnotatedResult.","triggerScenarios":"Querying the AMERIBOR fetcher with a date range outside FRED's coverage for those series IDs (AMBOR30/AMBOR90 etc.), or a start_date after the series' last observation (some AMERIBOR tenors were discontinued).","commonSituations":"Requesting recent dates for discontinued AMERIBOR tenor series (e.g. AMBOR30T/AMBOR90T replaced over time); overly narrow date windows between business days; FRED series temporarily empty during publication lags.","solutions":["Check the series on fred.stlouisfed.org (AMERIBOR, AMBOR30, AMBOR90) for the actual observation date range and query within it","Widen start_date/end_date or remove them to get the full history","Shift the requested window a few days earlier to account for publication lag","Retry later - FRED observations can lag real time by days"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pandas import DataFrame\nraw = fetch_fred_series(['AMERIBOR', 'AMBOR30', 'AMBOR90'], start_date, end_date)\nassert raw.get('data'), 'no AMERIBOR observations in window - widen dates'","typeGuard":"def has_observations(payload: dict) -> bool:\n    return bool(payload.get(\"data\"))","tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\ntry:\n    obs = await obb.fixedincome.ameribor(provider='fred', start_date=s, end_date=e).await_to_list()\nexcept EmptyDataError:\n    obs = []  # widen window or shift earlier","preventionTips":["Check each AMERIBOR tenor's observation range on fred.stlouisfed.org before querying","Account for FRED publication lag - avoid windows ending today","Query full history once and filter locally instead of guessing narrow windows"],"tags":["fred","ameribor","rates","empty-data","date-range"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}