OpenBB-finance/OpenBB · error · RuntimeError

Unable to process supplied data.

Error message

Unable to process supplied data.

What it means

In the BLS charting view, when the supplied payload is neither a non-empty pandas DataFrame nor successfully convertible via basemodel_to_df, the generic conversion failure is wrapped as RuntimeError('Unable to process supplied data.') with the original exception chained. It means the object passed as data/obbject_item could not be turned into a tabular frame at all.

Source

Thrown at openbb_platform/extensions/economy/openbb_economy/economy_views.py:376

        if provider != "bls":
            raise RuntimeError(
                f"This charting method does not support {provider}. Supported providers: bls."
            )

        _data = (
            kwargs.pop("data", None)
            if "data" in kwargs and kwargs["data"] is not None
            else kwargs.get("obbject_item")
        )
        df = DataFrame()

        if isinstance(_data, DataFrame) and not _data.empty:
            df = _data.reset_index() if _data.index.name == "date" else _data
        else:
            try:
                df = basemodel_to_df(_data, index=None)  # type: ignore
            except Exception as e:
                raise RuntimeError("Unable to process supplied data.") from e

        if df.empty or len(df) < 2:
            raise RuntimeError("No data found to plot.")

        cols = df.columns.to_list()
        target_col = kwargs.get("target_col", "value")
        if target_col not in cols:
            raise RuntimeError(f"Column '{target_col}' not found in the data.")

        new_df = df.pivot(columns="symbol", values=target_col, index="date")
        target_symbols = kwargs.get("target_symbol", "").split(",")[:10]  # type: ignore

        if not target_symbols or len(target_symbols) == 0 or target_symbols[0] == "":
            target_symbols = new_df.columns.to_list()[:10]

        metadata = kwargs["extra"].get("results_metadata", {})  # type: ignore
        ytitle = kwargs.get("ytitle", "")

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Pass a proper list of pydantic models (e.g. the OBBject .results list) or a pandas DataFrame.
  2. If you have raw records, normalize them first: df = pd.DataFrame(records) and pass data=df.
  3. Check the chained exception (raise __cause__) to see the real conversion error.
  4. Upgrade openbb packages together (openbb-core provides basemodel_to_df) so converter and models match.

Example fix

# before
fig = views.economy_bls_chart(data={'LNS14000000': [3.5, 3.6]})  # dict not supported

# after
import pandas as pd
df = pd.DataFrame({'symbol':'LNS14000000','date':pd.date_range('2024-01-01',periods=2),'value':[3.5,3.6]})
fig = views.economy_bls_chart(data=df)
Defensive patterns

Strategy: type-guard

Validate before calling

from pandas import DataFrame
payload = kwargs.get('data') or kwargs.get('obbject_item')
assert isinstance(payload, (DataFrame, list)), (
    'data must be a DataFrame or a list of models'
)

Type guard

from pandas import DataFrame
from typing import Any

def is_chartable_payload(payload: Any) -> bool:
    """True when payload is a non-empty DataFrame or a non-empty list."""
    if isinstance(payload, DataFrame):
        return not payload.empty
    return isinstance(payload, list) and len(payload) > 0

Try / catch

try:
    fig = views.bls_chart(**kwargs)
except RuntimeError as e:
    if str(e) == 'Unable to process supplied data.' and e.__cause__:
        print('conversion failed:', repr(e.__cause__))  # diagnose the real error
    raise

Prevention

When it happens

Trigger: Passing data= as a dict, a JSON string, a single BaseModel instead of a list, None, or a results object whose fields basemodel_to_df cannot serialize; passing a list of dicts with inconsistent keys.

Common situations: Building custom pipelines that hand raw JSON or nested objects into the charting view, version mismatches where basemodel_to_df's accepted input types changed, or passing an OBBject instead of .results.

Related errors


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