OpenBB-finance/OpenBB · error · OpenBBError
\n".join(messages)
Error message
\n".join(messages)
What it means
Finviz key metrics fetcher aggregates per-symbol failures: when every requested symbol produced an entry in `messages` (per-symbol errors/warnings collected in get_one) and no results came back, it raises OpenBBError joining all messages with newlines. The joined text identifies which symbols failed and why (usually 'No data found for SYMBOL').
Solutions
- Read the joined messages: each line names the failing symbol and reason
- Retry with only the symbols that are valid Finviz tickers
- Split the batch and process per symbol, skipping failures, if partial data is acceptable
Example fix
# before res = await obb.equity.fundamental.metrics(provider="finviz", symbol="ZZZZ,YYYY") # OpenBBError: No data found for ZZZZ\nNo data found for YYYY # after res = await obb.equity.fundamental.metrics(provider="finviz", symbol="AAPL,MSFT")
Defensive patterns
Strategy: try-catch
Validate before calling
def split_symbols(raw: str) -> list[str]:
return [s.strip() for s in raw.split(",") if s.strip()]
symbols = split_symbols(query_symbol)
assert symbols, "symbol list empty" Try / catch
from openbb_core.app.model.obb_error import OpenBBError
try:
results = await FinvizKeyMetricsFetcher.transform_query(...)
except OpenBBError as e:
failed = [ln for ln in str(e).splitlines() if "No data" in ln]
# drop the named symbols and retry the remainder Prevention
- Pre-validate tickers against Finviz coverage before batch metric pulls
- Parse the per-line messages to identify failing symbols automatically
- Process symbols individually and skip failures when partial results suffice
When it happens
Trigger: Passing a comma-separated symbol list where every ticker fails on Finviz (invalid, delisted, or no metrics row); upstream HTTP errors for each symbol captured into messages.
Common situations: Batch metric pulls over a dirty ticker universe; symbols with exchange-specific spellings Finviz does not accept.
Related errors
- \n".join(messages)
- No data was returned for any symbol
- No data was returned for any symbol
- Invalid 'filters_dict' format. Must be a dictionary or…
- Invalid industry ' '. Available industries are
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/705c5aed47b32327.
Report an issue: GitHub.
Appendix: source
Thrown at openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py:281
float(str(fundament.get("Dividend %", None)).replace("%", ""))
/ 100
if fundament.get("Dividend %", "-") != "-"
else None
),
}
)
return result
symbols = query.symbol.split(",")
for symbol in symbols:
result = get_one(symbol)
if result is not None and result:
results.append(result)
if not results and messages:
raise OpenBBError("\n".join(messages))
if not results and not messages:
raise EmptyDataError("No data was returned for any symbol")
if results and messages:
for message in messages:
warn(message)
return results
@staticmethod
def transform_data(
query: FinvizKeyMetricsQueryParams,
data: list[dict],
**kwargs: Any,
) -> list[FinvizKeyMetricsData]:
"""Transform and validate the raw data."""
return [FinvizKeyMetricsData.model_validate(d) for d in data]View on GitHub (pinned to 3e071fcc2c)