OpenBB-finance/OpenBB · warning · EmptyDataError
No data was returned -> \n{messages[-1]}
Error message
No data was returned -> \n{messages[-1]} What it means
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.
Source
Thrown at openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/historical_eps.py:151
result = [
{
"symbol": symbol,
**d,
}
for d in data.get(target, []) # type: ignore
]
if query.limit is not None:
results.extend(result[: query.limit])
else:
results.extend(result)
# If no data is returned, raise a warning and move on to the next symbol.
if not data:
warn(f"Symbol Error: No data found for {symbol}")
await amake_requests(urls, response_callback, **kwargs) # type: ignore
if not results:
raise EmptyDataError(f"No data was returned -> \n{messages[-1]}")
return results
@staticmethod
def transform_data(
query: AlphaVantageHistoricalEpsQueryParams,
data: list[dict],
**kwargs: Any,
) -> list[AlphaVantageHistoricalEpsData]:
"""Transform the raw data into the standard model."""
if not data:
raise EmptyDataError("No data found.")
return [AlphaVantageHistoricalEpsData.model_validate(d) for d in data]
View on GitHub (pinned to 3e071fcc2c)
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.
Example fix
# before
res = await obbject.equity.fundamental.income(symbol="BRK.B", provider="alpha_vantage", period="annual")
# after
from openbb_core.provider.standard_models.errors import EmptyDataError
try:
res = await obbject.equity.fundamental.income(symbol="BRK-B", provider="alpha_vantage", period="annual")
except EmptyDataError:
res = await obbject.equity.fundamental.income(symbol="BRK-B", provider="fmp", period="annual") Defensive patterns
Strategy: try-catch
Validate before calling
from av_symbol_lookup import is_valid_av_symbol # pseudo
if not is_valid_av_symbol(symbol):
symbol = symbol.replace(".", "-") # AV share-class format
# also pre-check quota: alpha_vantage free tier is heavily rate-limited Try / catch
from openbb_core.provider.standard_models.errors import EmptyDataError
try:
result = await fetcher.a_fetch_data(query, credentials)
except EmptyDataError as e:
logger.info("no AV EPS data for %s (%s)", symbol, e)
result = [] Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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').
Related errors
- No data found.
- No ratings data returned.
- The request was returned empty.
- [Empty] -> {e}
- Unexpected data format. Expected 'analyst_ratings_analyst' k
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/4d16e16ad61cac92.
Report an issue: GitHub.