{"record":{"id":"67c68ae74ac250a5","repo":"OpenBB-finance/OpenBB","slug":"the-request-was-returned-empty-67c68a","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/fmp/openbb_fmp/models/economic_calendar.py","lineNumber":140,"sourceCode":"        async def get_one(url):\n            \"\"\"Get data for one URL.\"\"\"\n            n_urls = 1\n            try:\n                result = await amake_request(url, response_callback=response_callback)\n                if result:\n                    results.extend(result)\n            except UnauthorizedError as e:\n                raise e from e\n            except OpenBBError as e:\n                if len(urls) == 1 or (len(urls) > 1 and n_urls == len(urls)):\n                    raise e from e\n                warnings.warn(f\"Error in fetching part of the data from FMP -> {e}\")\n            n_urls += 1\n\n        await asyncio.gather(*[get_one(url) for url in urls])\n\n        if not results:\n            raise EmptyDataError(\"The request was returned empty.\")\n\n        return results\n\n    @staticmethod\n    def transform_data(\n        query: FMPEconomicCalendarQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> list[FMPEconomicCalendarData]:\n        \"\"\"Transform the data.\"\"\"\n        return [FMPEconomicCalendarData.model_validate(d) for d in data]\n","sourceCodeStart":122,"sourceCodeEnd":152,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fmp/openbb_fmp/models/economic_calendar.py#L122-L152","documentation":"Raised as EmptyDataError by FMPEconomicCalendar.a_url after all URLs for the (possibly chunked) date range were gathered: if every chunk either returned nothing or failed with a non-fatal OpenBBError (which is only warned about for multi-URL runs), 'results' stays empty and this error is raised. Note that UnauthorizedError is always re-raised, so this is not an auth failure.","triggerScenarios":"Calling obb.economy.calendar(provider='fmp', start_date=..., end_date=...) where the window contains no events, or where every per-chunk request failed with a non-auth error (rate limit, 5xx) that was downgraded to a warning, leaving zero rows.","commonSituations":"Weekend/holiday windows with no economic events, date chunks racing FMP rate limits (each failure only warns), large ranges split into many URLs where all chunks silently failed, expired key raising UnauthorizedError instead (different error).","solutions":["Retry after a short delay - per-chunk failures from rate limiting are only warned, so a retry may succeed","Narrow the date range to a window known to contain events (e.g. a weekday around a Fed meeting)","Check emitted warnings above the error - they carry the per-URL failure reasons ('Error in fetching part of the data from FMP -> ...')","If it persists, call FMP's economic-calendar endpoint directly with the same key to check upstream status"],"exampleFix":"# before\nres = obb.economy.calendar(provider='fmp', start_date='2024-12-25', end_date='2024-12-26')  # quiet window\n\n# after\nres = obb.economy.calendar(provider='fmp', start_date='2024-12-18', end_date='2024-12-20')","handlingStrategy":"retry","validationCode":"from datetime import date, timedelta\n# prefer windows likely to contain events (business days)\nif (end_date - start_date).days >= 3 or (end_date - start_date).days < 0:\n    raise ValueError('Pick a compact, past-facing window of a few business days')","typeGuard":"null","tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\nimport asyncio\nfor attempt in range(3):\n    try:\n        cal = await obb.economy.calendar.async_(provider='fmp', start_date=s, end_date=e)\n        break\n    except EmptyDataError:\n        if attempt == 2:\n            cal = []\n        else:\n            await asyncio.sleep(2 ** attempt)  # per-chunk fetch failures were only warned","preventionTips":["Inspect warnings alongside the error - per-URL failures are downgraded to warnings","Rate-limit your own request cadence to avoid per-chunk throttling on long ranges","Retry with backoff: partial upstream failures often clear immediately"],"tags":["fmp","empty-data","economic-calendar","rate-limit"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}