OpenBB-finance/OpenBB · error · OpenBBError

\n".join(messages)

Error message

\n".join(messages)

What it means

Finviz price target fetcher mirrors the batch pattern: if every symbol's get_one recorded an error into `messages` and no rows were collected, it raises OpenBBError with all messages joined by newlines. Each message typically says which symbol had no price-target data or failed to fetch.

Source

Thrown at openbb_platform/providers/finviz/openbb_finviz/models/price_target.py:116

                    price_targets["adj_price_target"] == price_targets["price_target"],
                    "price_target",
                ] = None
                price_targets = price_targets.replace("", None).drop(columns="Price")
            except Exception as e:  # pylint: disable=W0718
                messages.append(f"Failed to get data for {symbol} -> {e}")
                return result
            result = price_targets.to_dict(orient="records")
            return result

        symbols = query.symbol.split(",") if query.symbol else []

        for symbol in symbols:
            result = get_one(symbol)
            if result:
                results.extend(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: FinvizPriceTargetQueryParams,
        data: list[dict],
        **kwargs: Any,
    ) -> list[FinvizPriceTargetData]:
        """Transform and validate the raw data."""
        return [FinvizPriceTargetData.model_validate(d) for d in data]

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Inspect the joined message lines to see per-symbol failure reasons
  2. Filter the symbol list to tickers with analyst coverage before requesting
  3. Add spacing/retry for rate-limit messages before giving up
Defensive patterns

Strategy: try-catch

Validate before calling

symbols = [s.strip() for s in (query.symbol or "").split(",") if s.strip()]
assert symbols, "price target query needs at least one symbol"

Try / catch

from openbb_core.app.model.obb_error import OpenBBError

try:
    results = await FinvizPriceTargetFetcher.transform_query(...)
except OpenBBError as e:
    bad = {ln.split()[-1] for ln in str(e).splitlines() if ln}
    # retry without `bad`, or record as no-coverage

Prevention

When it happens

Trigger: Requesting price targets for symbols Finviz has no analyst coverage for (small caps, OTC); all symbols failing due to rate limiting recorded as messages.

Common situations: Screening pipelines that pull targets for newly listed tickers; batch jobs hitting Finviz rate limits so every request errors.

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/5a41f00a48aa0e5b. Report an issue: GitHub.