OpenBB-finance/OpenBB · warning · EmptyDataError

No data was returned for any symbol

Error message

No data was returned for any symbol

What it means

Finviz price target raises EmptyDataError('No data was returned for any symbol') when the loop over symbols produced zero rows and no error messages were collected. Distinguished from the OpenBBError variant: here symbols were accepted but returned nothing, so there is nothing to report.

Source

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

                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. Ensure a non-empty symbol string is supplied
  2. Verify coverage with a single symbol request before batching
  3. Treat EmptyDataError as expected for coverage-less tickers

Example fix

# before
await obb.equity.price_target(provider="finviz", symbol="")  # EmptyDataError

# after
await obb.equity.price_target(provider="finviz", symbol="AAPL")
Defensive patterns

Strategy: validation

Validate before calling

assert query.symbol and query.symbol.strip(), "symbol is required for finviz price targets"

Try / catch

from openbb_core.provider.abstract.errors import EmptyDataError

try:
    res = await obb.equity.price_target(provider="finviz", symbol=sym)
except EmptyDataError:
    res = []  # no coverage for these tickers

Prevention

When it happens

Trigger: Symbols with no analyst price targets on Finviz; an empty symbol string (query.symbol falsy gives an empty list and immediate EmptyDataError).

Common situations: Passing symbol='' or None through a template; illiquid tickers without analyst coverage.

Related errors


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