OpenBB-finance/OpenBB · warning · EmptyDataError
No data found.
Error message
No data found.
What it means
AlphaVantageHistoricalEpsFetcher.transform_data (historical_eps.py:163) is the standard OpenBB fetcher stage that converts raw dicts into AlphaVantageHistoricalEpsData models; if the list handed to it is empty it raises EmptyDataError("No data found."). Normally a_fetch_data already guards empties, so seeing this means transform_data was called directly with [] or data was dropped between stages.
Source
Thrown at openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/historical_eps.py:163
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
- Check for empty data before calling transform: if not data: return [].
- In tests, supply at least one well-formed report dict matching AlphaVantageHistoricalEpsData fields.
- Avoid slicing/filtering between a_fetch_data and transform_data without re-checking emptiness.
- Catch EmptyDataError where the pipeline runs and map it to an empty result set.
Example fix
# before rows = AlphaVantageHistoricalEpsFetcher.transform_data(query, []) # EmptyDataError: No data found. # after rows = AlphaVantageHistoricalEpsFetcher.transform_data(query, data) if data else []
Defensive patterns
Strategy: validation
Validate before calling
if not data:
return []
rows = AlphaVantageHistoricalEpsFetcher.transform_data(query, data) Type guard
def has_reports(data: list[dict]) -> bool:
return bool(data) and any("fiscalDateEnding" in row or "annualReports" in row for row in data) Try / catch
from openbb_core.provider.standard_models.errors import EmptyDataError
try:
rows = AlphaVantageHistoricalEpsFetcher.transform_data(query, data)
except EmptyDataError:
rows = [] Prevention
- Guard transform_data calls with an emptiness check.
- Give test fixtures at least one realistic report dict.
- Don't filter provider output between fetch and transform without re-checking emptiness.
When it happens
Trigger: Calling the fetcher's transform_data(query, []) directly (unit tests, custom pipelines), or wiring a fetcher result where the data list was filtered to nothing.
Common situations: Test fixtures that pass empty lists; custom router code that slices provider output to [] before transform; provider responses whose 'annualReports' arrays are all empty so an intermediate filter yields [].
Related errors
- No data was returned -> \n{messages[-1]}
- 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/f058cc02520a0fbd.
Report an issue: GitHub.