{"record":{"id":"1f7cfa934a21dba8","repo":"OpenBB-finance/OpenBB","slug":"the-request-was-returned-empty-1f7cfa","errorCode":null,"errorMessage":"The request was returned empty.","messagePattern":"The request was returned empty\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/intrinio/openbb_intrinio/models/currency_pairs.py","lineNumber":74,"sourceCode":"        # pylint: disable=import-outside-toplevel\n        from openbb_intrinio.utils.helpers import get_data_many\n\n        api_key = credentials.get(\"intrinio_api_key\") if credentials else \"\"\n\n        base_url = \"https://api-v2.intrinio.com\"\n        url = f\"{base_url}/forex/pairs?api_key={api_key}\"\n        return await get_data_many(url, \"pairs\", **kwargs)\n\n    @staticmethod\n    def transform_data(\n        query: IntrinioCurrencyPairsQueryParams, data: list[dict], **kwargs: Any\n    ) -> list[IntrinioCurrencyPairsData]:\n        \"\"\"Return the transformed data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from pandas import DataFrame\n\n        if not data:\n            raise EmptyDataError(\"The request was returned empty.\")\n        df = DataFrame(data)\n        if query.query:\n            df = df[\n                df[\"code\"].str.contains(query.query, case=False)\n                | df[\"base_currency\"].str.contains(query.query, case=False)\n                | df[\"quote_currency\"].str.contains(query.query, case=False)\n            ]\n        if len(df) == 0:\n            raise EmptyDataError(\n                f\"No results were found with the query supplied. -> {query.query}\"\n                + \" Hint: Names and descriptions are not searchable from Intrinio, try 3-letter symbols.\"\n            )\n        return [\n            IntrinioCurrencyPairsData.model_validate(d)\n            for d in df.to_dict(orient=\"records\")\n        ]\n","sourceCodeStart":56,"sourceCodeEnd":91,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/intrinio/openbb_intrinio/models/currency_pairs.py#L56-L91","documentation":"Raised in IntrinioCurrencyPairsFetcher.transform_data when the raw list handed back from get_data_many(url, 'pairs') is empty. The currency-pairs endpoint normally returns the full list of supported forex pairs, so an empty payload is unusual and is treated as an empty-data condition via EmptyDataError.","triggerScenarios":"The Intrinio /forex/pairs endpoint returns an empty 'pairs' array — e.g. the API product is not enabled for the account, a transient empty response, or an upstream change in the response shape so the 'pairs' key yields nothing.","commonSituations":"Subscriptions without the Forex API product; schema drift after Intrinio changes the response (key renamed) making get_data_many extract zero records; service degradation returning 200 with empty body.","solutions":["Retry once — transient empty responses happen","Verify the credential can access the forex endpoints: curl 'https://api-v2.intrinio.com/forex/pairs?api_key=<key>'","Inspect the raw response for shape changes (does the JSON still use the 'pairs' key?) and report/update the provider if it changed","Fall back to another provider for currency pairs if available"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"def intrinio_forex_accessible(api_key: str) -> bool:\n    import requests\n    r = requests.get(f\"https://api-v2.intrinio.com/forex/pairs?api_key={api_key}\", timeout=10)\n    return r.ok and bool(r.json().get(\"pairs\"))","typeGuard":"from openbb_core.provider.utils.errors import EmptyDataError","tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\n\nfor attempt in range(2):\n    try:\n        pairs = obb.currency.currency_pairs(provider=\"intrinio\").to_df()\n        break\n    except EmptyDataError:\n        if attempt == 1:\n            pairs = None  # likely plan/endpoint issue — surface to user\n        # one retry covers transient empty responses","preventionTips":["Verify the Intrinio plan includes the Forex API before building on this endpoint","Cache the pairs list — it changes rarely and one fetch protects against transient empties","Alert when a normally-non-empty reference endpoint returns empty (shape drift signal)"],"tags":["empty-data","forex","intrinio","currency-pairs"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}