OpenBB-finance/OpenBB · warning · EmptyDataError
No data found.
Error message
No data found.
What it means
EmptyDataError raised in IntrinioEtfSearchFetcher.transform_data when the fetched data list is empty before DataFrame conversion. This fires when the fetcher returned nothing at all — distinct from the post-filter case, since the regex name filter is applied after this check.
Source
Thrown at openbb_platform/providers/intrinio/openbb_intrinio/models/etf_search.py:133
if "etfs" in results and len(results.get("etfs")) > 0: # type: ignore
data.extend(results.get("etfs")) # type: ignore
return data
return await amake_request(url, response_callback=response_callback, **kwargs) # type: ignore
@staticmethod
def transform_data(
query: IntrinioEtfSearchQueryParams,
data: list[dict],
**kwargs: Any,
) -> list[IntrinioEtfSearchData]:
"""Transform data."""
# pylint: disable=import-outside-toplevel
import re # noqa
from pandas import DataFrame # noqa
if not data:
raise EmptyDataError("No data found.")
results = DataFrame(data)
if query.query:
pattern = f".*{re.escape(query.query)}.*"
results = results[
results["name"].str.contains(pattern, case=False, regex=True)
]
return [
IntrinioEtfSearchData.model_validate(d)
for d in results.to_dict(orient="records")
]
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Broaden the search term (e.g. 'tech' instead of 'semiconductor leverage')
- Search by issuer or well-known fund names; drop the query parameter to list ETFs
- Catch EmptyDataError and show 'no ETFs matched' in the UI rather than an error
Example fix
# before res = obb.etf.search(provider="intrinio", query="quantum computing leverage") # after res = obb.etf.search(provider="intrinio", query="quantum")
Defensive patterns
Strategy: try-catch
Validate before calling
def query_broad_enough(q: str, min_len: int = 3) -> bool:
return len((q or "").strip()) >= min_len Type guard
from openbb_core.provider.utils.errors import EmptyDataError
Try / catch
from openbb_core.provider.utils.errors import EmptyDataError
try:
res = await obb.etf.search(provider="intrinio", query=q)
except EmptyDataError:
res = await obb.etf.search(provider="intrinio", query=q[:4]) # broaden term Prevention
- Start broad and narrow client-side instead of starting narrow
- Catch EmptyDataError as 'no matches' UX, not an exception
- Prefer issuer names or short keywords
When it happens
Trigger: ETF search where Intrinio returns no 'etfs' array (or an empty one) for the request: searches with zero hits, or responses where only a 'messages' key was present but empty enough not to raise error 672. Also raised when the fallback unfiltered call returned nothing.
Common situations: Searching obscure terms with no ETF matches; regional/language-specific queries; API returning empty results during degraded service.
Related errors
- Error: The request was returned as empty. Try adjusting the
- No results were found with the query supplied. -> {query.que
- The request was returned empty.
- No holdings were found for {query.symbol}, and the response
- No data was returned.
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/ab7e2b398fe43951.
Report an issue: GitHub.