{"record":{"id":"e77382e04526d56a","repo":"OpenBB-finance/OpenBB","slug":"the-screener-variable-section-key-shouldn-t-ex","errorCode":null,"errorMessage":"The screener variable {section}.{key} shouldn't exist!\n","messagePattern":"The screener variable (.+?)\\.(.+?) shouldn't exist!\n","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/finviz/openbb_finviz/models/equity_screener.py","lineNumber":618,"sourceCode":"        }\n\n        if data_type in screen_type:\n            screen = screen_type[data_type]()\n\n        if preset is not None:\n            preset_filter = configparser.RawConfigParser()\n            preset_filter.optionxform = str  # type: ignore\n            preset_filter.read(preset_choices[preset])\n            d_general = preset_filter[\"General\"]\n            d_filters = {\n                **preset_filter[\"Descriptive\"],\n                **preset_filter[\"Fundamental\"],\n                **preset_filter[\"Technical\"],\n            }\n            for section in [\"General\", \"Descriptive\", \"Fundamental\", \"Technical\"]:\n                for key, val in {**preset_filter[section]}.items():\n                    if key not in d_check_screener:\n                        raise OpenBBError(\n                            f\"The screener variable {section}.{key} shouldn't exist!\\n\"\n                        )\n\n                    if val not in d_check_screener[key]:\n                        raise OpenBBError(\n                            f\"Invalid [{section}] {key}={val}. \"\n                            f\"Choose one of the following options:\\n{', '.join(d_check_screener[key])}.\\n\"\n                        )\n\n            d_filters = {k: v for k, v in d_filters.items() if v is not None}\n            screen.set_filter(filters_dict=d_filters)\n            asc = None\n\n            asc = d_general.get(\"Ascend\")\n\n            if asc is not None:\n                ascend = asc == \"true\"\n","sourceCodeStart":600,"sourceCodeEnd":636,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/finviz/openbb_finviz/models/equity_screener.py#L600-L636","documentation":"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.","triggerScenarios":"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.","commonSituations":"Users adding filters by guessing key names instead of copying from the shipped template; sharing preset files across machines with different package versions.","solutions":["Remove or correct the offending key named in the error message ({section}.{key})","Diff your INI against the bundled screener_template.ini to find allowed keys","Pin the finvizfinance version the preset was authored against, or regenerate the preset"],"exampleFix":"; before (my_screen.ini)\n[Descriptive]\nPe Rratio = Over 10   ; typo key -> 'The screener variable Descriptive.Pe Rratio shouldn't exist!'\n\n; after\n[Descriptive]\nP/E = Over 10","handlingStrategy":"validation","validationCode":"import configparser\nfrom openbb_finviz.models.equity_screener import (  # allowed-keys schema\n    FinvizEquityScreenerQueryParams,\n)\n# Practical check: compare INI keys against the shipped screener_template.ini keys\n\ndef lint_preset(ini_path, template_path) -> list[str]:\n    def keys(p):\n        c = configparser.RawConfigParser(); c.optionxform = str; c.read(p)\n        return {(s, k) for s in c.sections() for k in c[s]}\n    return [f\"{s}.{k}\" for s, k in keys(ini_path) - keys(template_path)]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use keys present in the shipped screener_template.ini","Lint custom INIs against the template in CI","Re-validate preset files after finvizfinance upgrades"],"tags":["openbb","finviz","preset","ini","validation"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}