{"record":{"id":"3aa33156a88de5b5","repo":"OpenBB-finance/OpenBB","slug":"no-data-was-returned-for-any-symbol-3aa331","errorCode":null,"errorMessage":"No data was returned for any symbol","messagePattern":"No data was returned for any symbol","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py","lineNumber":284,"sourceCode":"                        else None\n                    ),\n                }\n            )\n\n            return result\n\n        symbols = query.symbol.split(\",\")\n\n        for symbol in symbols:\n            result = get_one(symbol)\n            if result is not None and result:\n                results.append(result)\n\n        if not results and messages:\n            raise OpenBBError(\"\\n\".join(messages))\n\n        if not results and not messages:\n            raise EmptyDataError(\"No data was returned for any symbol\")\n\n        if results and messages:\n            for message in messages:\n                warn(message)\n\n        return results\n\n    @staticmethod\n    def transform_data(\n        query: FinvizKeyMetricsQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> list[FinvizKeyMetricsData]:\n        \"\"\"Transform and validate the raw data.\"\"\"\n        return [FinvizKeyMetricsData.model_validate(d) for d in data]\n","sourceCodeStart":266,"sourceCodeEnd":300,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py#L266-L300","documentation":"Finviz key metrics raises EmptyDataError('No data was returned for any symbol') when the per-symbol loop yields nothing and, unlike the messages case, no per-symbol errors were recorded. The request succeeded but each symbol silently returned an empty payload.","triggerScenarios":"All tickers in the list resolve but have no metrics data on Finviz; empty/whitespace symbol strings after splitting; a Finviz page-layout change making the parser return None without erroring.","commonSituations":"Recently added or OTC tickers with sparse Finviz coverage; passing a symbol string of only commas.","solutions":["Sanitize the symbol list (strip, drop empties) before querying","Test a single well-known ticker (AAPL) to confirm the provider works, then bisect your list","Handle EmptyDataError as 'no coverage' rather than retrying blindly"],"exampleFix":"# before\nawait obb.equity.fundamental.metrics(provider=\"finviz\", symbol=\",,, \")  # EmptyDataError\n\n# after\nsymbols = \",\".join(s.strip() for s in raw.split(\",\") if s.strip())\nawait obb.equity.fundamental.metrics(provider=\"finviz\", symbol=symbols)","handlingStrategy":"try-catch","validationCode":"symbols = [s.strip() for s in raw.split(\",\") if s.strip()]\nassert symbols, \"no usable symbols supplied\"","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.abstract.errors import EmptyDataError\n\ntry:\n    results = await FinvizKeyMetricsFetcher.transform_query(...)\nexcept EmptyDataError:\n    results = []  # silent empty: coverage gap on Finviz","preventionTips":["Sanitize symbol strings (strip empties) before querying","Bisect large symbol lists to isolate coverage gaps","Do not retry EmptyDataError — it is deterministic for a given symbol set"],"tags":["openbb","finviz","empty-data","key-metrics"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}