OpenBB-finance/OpenBB · error · OpenBBError

The screener variable {section}.{key} shouldn't exist!

Error message

The screener variable {section}.{key} shouldn't exist!

What it means

While parsing a preset INI file, the Finviz screener found a key in one of the sections (General/Descriptive/Fundamental/Technical) that is not in its d_check_screener schema of known filter keys. Any unrecognized variable aborts the run. This protects against typos and against keys from newer/older finvizfinance template versions.

Source

Thrown at openbb_platform/providers/finviz/openbb_finviz/models/equity_screener.py:618

        }

        if data_type in screen_type:
            screen = screen_type[data_type]()

        if preset is not None:
            preset_filter = configparser.RawConfigParser()
            preset_filter.optionxform = str  # type: ignore
            preset_filter.read(preset_choices[preset])
            d_general = preset_filter["General"]
            d_filters = {
                **preset_filter["Descriptive"],
                **preset_filter["Fundamental"],
                **preset_filter["Technical"],
            }
            for section in ["General", "Descriptive", "Fundamental", "Technical"]:
                for key, val in {**preset_filter[section]}.items():
                    if key not in d_check_screener:
                        raise OpenBBError(
                            f"The screener variable {section}.{key} shouldn't exist!\n"
                        )

                    if val not in d_check_screener[key]:
                        raise OpenBBError(
                            f"Invalid [{section}] {key}={val}. "
                            f"Choose one of the following options:\n{', '.join(d_check_screener[key])}.\n"
                        )

            d_filters = {k: v for k, v in d_filters.items() if v is not None}
            screen.set_filter(filters_dict=d_filters)
            asc = None

            asc = d_general.get("Ascend")

            if asc is not None:
                ascend = asc == "true"

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Remove or correct the offending key named in the error message ({section}.{key})
  2. Diff your INI against the bundled screener_template.ini to find allowed keys
  3. Pin the finvizfinance version the preset was authored against, or regenerate the preset

Example fix

; before (my_screen.ini)
[Descriptive]
Pe Rratio = Over 10   ; typo key -> 'The screener variable Descriptive.Pe Rratio shouldn't exist!'

; after
[Descriptive]
P/E = Over 10
Defensive patterns

Strategy: validation

Validate before calling

import configparser
from openbb_finviz.models.equity_screener import (  # allowed-keys schema
    FinvizEquityScreenerQueryParams,
)
# Practical check: compare INI keys against the shipped screener_template.ini keys

def lint_preset(ini_path, template_path) -> list[str]:
    def keys(p):
        c = configparser.RawConfigParser(); c.optionxform = str; c.read(p)
        return {(s, k) for s in c.sections() for k in c[s]}
    return [f"{s}.{k}" for s, k in keys(ini_path) - keys(template_path)]

Prevention

When it happens

Trigger: Hand-editing the INI and adding a made-up key like 'Pe Rratio'; using a template copied from an incompatible finvizfinance version whose keys changed; leaving debug placeholders in the file.

Common situations: Users adding filters by guessing key names instead of copying from the shipped template; sharing preset files across machines with different package versions.

Related errors


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