OpenBB-finance/OpenBB · error · OpenBBError

Error: column '{column}' not found in data

Error message

Error: column '{column}' not found in data

What it means

Raised near the end of OptionsChainsData.filter_data when the column= filter names a column that does not exist in the (possibly already filtered) DataFrame. After moneyness/date/option_type narrowing, the requested column is checked against df.columns before the notnull()/value_min/value_max filters are applied.

Source

Thrown at openbb_platform/core/openbb_core/provider/utils/options_chains_properties.py:368

        if moneyness is not None:
            df_calls = DataFrame(
                df[df.strike >= df.underlying_price].query("option_type == 'call'")
            )
            df_puts = DataFrame(
                df[df.strike <= df.underlying_price].query("option_type == 'put'")
            )
            df = concat([df_calls, df_puts])

        if date is not None:
            date = self._get_nearest_expiration(date)
            df = DataFrame(df[df.expiration.astype(str) == date])

        if option_type is not None:
            df = DataFrame(df[df.option_type == option_type])

        if column is not None:
            if column not in df.columns:
                raise OpenBBError(f"Error: column '{column}' not found in data")
            df = DataFrame(df[df[column].notnull()])
            if value_min is not None and value_max is not None:
                df = DataFrame(
                    df[
                        (df[column].abs() >= value_min)
                        & (df[column].abs() <= value_max)
                    ]
                )
            elif value_min is not None:
                df = DataFrame(df[df[column].abs() >= value_min])
            elif value_max is not None:
                df = DataFrame(df[df[column].abs() <= value_max])
            else:
                df = DataFrame(df.sort_values(by=column, ascending=False))

        return df.reset_index(drop=True)

    def _get_stat(

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Inspect available columns first: print(res.dataframe.columns.tolist()) and use one of them exactly
  2. Check availability flags (res.has_iv, res.has_greeks) before filtering on IV/greeks columns
  3. Spell the column exactly as the DataFrame shows; watch for provider-specific naming

Example fix

# before
df = res.filter_data(column="iv", value_min=0.1)  # provider returned no IV -> OpenBBError

# after
if "iv" in res.dataframe.columns:
    df = res.filter_data(column="iv", value_min=0.1)
else:
    df = res.filter_data(column="volume", value_min=100)
Defensive patterns

Strategy: validation

Validate before calling

cols = res.dataframe.columns.tolist()
if column not in cols:
    raise KeyError(f"column '{column}' not in available: {cols}")
df = res.filter_data(column=column, value_min=value_min, value_max=value_max)

Type guard

def column_exists(res, column: str) -> bool:
    return column in res.dataframe.columns

Try / catch

from openbb_core.app.model.abstract.error import OpenBBError

try:
    df = res.filter_data(column=column)
except OpenBBError as e:
    if "not found in data" in str(e):
        column = "volume"  # or pick interactively from res.dataframe.columns
        df = res.filter_data(column=column)
    else:
        raise

Prevention

When it happens

Trigger: result.filter_data(column='iv') when the provider returned no implied volatility; filtering on 'delta'/'gamma' without greeks; a column dropped by earlier filters; a plain typo ('stike').

Common situations: Provider-dependent column coverage: code assuming IV always present breaks on greeks-free providers; column names differing between providers (e.g. 'bid' vs 'bid_size'); chained filters where the first filter empties or narrows columns.

Related errors


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