{"record":{"id":"4c89e8d3813b5b06","repo":"OpenBB-finance/OpenBB","slug":"the-request-was-returned-empty","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/benzinga/openbb_benzinga/models/company_news.py","lineNumber":177,"sourceCode":"        results: list = []\n\n        async def get_one(url):\n            \"\"\"Get data for one url.\"\"\"\n            try:\n                response = await amake_request(\n                    url,\n                    response_callback=response_callback,\n                    **kwargs,\n                )\n                if response:\n                    results.extend(response)\n            except (OpenBBError, UnauthorizedError) as e:\n                raise e from e\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 sorted(\n            results, key=lambda x: x.get(\"created\"), reverse=query.order == \"desc\"\n        )[: query.limit if query.limit else len(results)]\n\n    @staticmethod\n    def transform_data(\n        query: BenzingaCompanyNewsQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> list[BenzingaCompanyNewsData]:\n        \"\"\"Transform data.\"\"\"\n        return [BenzingaCompanyNewsData.model_validate(item) for item in data]\n","sourceCodeStart":159,"sourceCodeEnd":191,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/benzinga/openbb_benzinga/models/company_news.py#L159-L191","documentation":"BenzingaCompanyNewsFetcher.a_fetch_data (company_news.py:177) gathers pages concurrently with asyncio.gather; if after all page callbacks `results` is still empty it raises EmptyDataError(\"The request was returned empty.\"). Empty means the filters matched no news, or every page errored into the caught OpenBBError/Unauthorized path without aborting. UnauthorizedError, when it occurs, is re-raised as-is upstream of this.","triggerScenarios":"Querying company news for tickers/date ranges with no coverage, size=0-style degenerate filters, or a date range entirely outside Benzinga's archive for those symbols.","commonSituations":"Weekend/holiday windows, pre-IPO or delisted tickers, non-US symbols Benzinga news doesn't tag, and typo'd date parameters producing empty windows.","solutions":["Catch EmptyDataError and return an empty news list to the UI.","Widen date range and confirm tickers; test the same query on a liquid name like AAPL.","Check credential health — sustained emptiness across all tickers suggests an auth problem rather than coverage.","Page-size sanity: keep a reasonable `size` and iterate `page` rather than one huge filtered request."],"exampleFix":"# before\nres = obbject.news.world.query(provider=\"benzinga\", date=\"2026-08-01\")\n\n# after\nfrom openbb_core.provider.standard_models.errors import EmptyDataError\ntry:\n    res = obbject.news.world.query(provider=\"benzinga\", date=\"2026-08-01\")\nexcept EmptyDataError:\n    res = []  # no coverage for that window","handlingStrategy":"try-catch","validationCode":"if not (query.symbols and query.start_date <= query.end_date):\n    raise ValueError(\"invalid company-news filter window\")\n# coverage probe on a liquid name\nprobe = await obbject.news.company(symbol=\"AAPL\", provider=\"benzinga\", limit=1)","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.standard_models.errors import EmptyDataError\ntry:\n    results = await fetcher.a_fetch_data(query, credentials)\nexcept EmptyDataError:\n    results = []  # no news matched the filters","preventionTips":["Validate date ranges and tickers before the request.","Expect empty results on off-hours and uncovered tickers; plan the empty UX.","If every query returns empty, suspect credentials, not coverage."],"tags":["python","openbb","benzinga","provider","empty-data"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}