{"record":{"id":"4d16e16ad61cac92","repo":"OpenBB-finance/OpenBB","slug":"no-data-was-returned-n-messages-1","errorCode":null,"errorMessage":"No data was returned -> \\n{messages[-1]}","messagePattern":"No data was returned -> \\\\n(.+?)","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/historical_eps.py","lineNumber":151,"sourceCode":"                result = [\n                    {\n                        \"symbol\": symbol,\n                        **d,\n                    }\n                    for d in data.get(target, [])  # type: ignore\n                ]\n                if query.limit is not None:\n                    results.extend(result[: query.limit])\n                else:\n                    results.extend(result)\n            # If no data is returned, raise a warning and move on to the next symbol.\n            if not data:\n                warn(f\"Symbol Error: No data found for {symbol}\")\n\n        await amake_requests(urls, response_callback, **kwargs)  # type: ignore\n\n        if not results:\n            raise EmptyDataError(f\"No data was returned -> \\n{messages[-1]}\")\n\n        return results\n\n    @staticmethod\n    def transform_data(\n        query: AlphaVantageHistoricalEpsQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> list[AlphaVantageHistoricalEpsData]:\n        \"\"\"Transform the raw data into the standard model.\"\"\"\n        if not data:\n            raise EmptyDataError(\"No data found.\")\n        return [AlphaVantageHistoricalEpsData.model_validate(d) for d in data]\n","sourceCodeStart":133,"sourceCodeEnd":165,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/historical_eps.py#L133-L165","documentation":"AlphaVantageHistoricalEpsFetcher.a_fetch_data (historical_eps.py:151) fans out one request per symbol via amake_requests, collecting provider messages; if after all callbacks `results` is empty it raises EmptyDataError(\"No data was returned -> \\n{messages[-1]}\") so the platform surfaces the provider's last message (typically 'Symbol Error' or an API-limit note). EmptyDataError is OpenBB's standard 'provider returned nothing' signal and maps to a clean empty result upstream.","triggerScenarios":"Requesting Alpha Vantage historical EPS for a symbol the endpoint has no annual-reports/quarterlyEarnings data for (small caps, delisted, wrong share class), or when AV's free-tier rate limit causes every callback to warn instead of populate results.","commonSituations":"Batch loops over many symbols without an AV premium key (5 req/day-style limits), tickers from non-US exchanges, or symbol formats AV doesn't recognize (e.g. 'BRK.B' vs 'BRK-B').","solutions":["Catch EmptyDataError and treat as no data for that symbol rather than a crash.","Verify the ticker against AV's symbol search; convert dot-suffixed share classes to AV's dash format.","Check the AV API key tier/rate limits — the trailing message in the error usually states the limit hit.","Fall back to another provider that covers the symbol (e.g. fmp) for the same field."],"exampleFix":"# before\nres = await obbject.equity.fundamental.income(symbol=\"BRK.B\", provider=\"alpha_vantage\", period=\"annual\")\n\n# after\nfrom openbb_core.provider.standard_models.errors import EmptyDataError\ntry:\n    res = await obbject.equity.fundamental.income(symbol=\"BRK-B\", provider=\"alpha_vantage\", period=\"annual\")\nexcept EmptyDataError:\n    res = await obbject.equity.fundamental.income(symbol=\"BRK-B\", provider=\"fmp\", period=\"annual\")","handlingStrategy":"try-catch","validationCode":"from av_symbol_lookup import is_valid_av_symbol  # pseudo\nif not is_valid_av_symbol(symbol):\n    symbol = symbol.replace(\".\", \"-\")  # AV share-class format\n# also pre-check quota: alpha_vantage free tier is heavily rate-limited","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.standard_models.errors import EmptyDataError\ntry:\n    result = await fetcher.a_fetch_data(query, credentials)\nexcept EmptyDataError as e:\n    logger.info(\"no AV EPS data for %s (%s)\", symbol, e)\n    result = []","preventionTips":["Batch Alpha Vantage calls within quota limits or use a premium key.","Normalize symbols to AV's dash format for share classes.","Treat EmptyDataError as a normal empty outcome, not a failure.","Prefer a fallback provider for broad symbol universes."],"tags":["python","openbb","alpha-vantage","provider","empty-data"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}