{"record":{"id":"08a8cea5f61f28c4","repo":"pola-rs/polars","slug":"config-has-no-option-opt-r","errorCode":null,"errorMessage":"`Config` has no option {opt!r}","messagePattern":"`Config` has no option (.+?)","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/config.py","lineNumber":386,"sourceCode":"        self._original_runtime_state = None\n\n    def __eq__(self, other: object) -> bool:\n        if not isinstance(other, Config):\n            return False\n        return (self._original_state == other._original_state) and (\n            self._context_options == other._context_options\n        )\n\n    def __ne__(self, other: object) -> bool:\n        return not self.__eq__(other)\n\n    def _set_config_params(self, **options: Unpack[ConfigParameters]) -> None:\n        for opt, value in options.items():\n            if not hasattr(self, opt) and not opt.startswith(\"set_\"):\n                opt = f\"set_{opt}\"\n            if not hasattr(self, opt):\n                msg = f\"`Config` has no option {opt!r}\"\n                raise AttributeError(msg)\n            getattr(self, opt)(value)\n\n    @classmethod\n    def load(cls, cfg: str) -> Config:\n        \"\"\"\n        Load (and set) previously saved Config options from a JSON string.\n\n        Parameters\n        ----------\n        cfg : str\n            JSON string produced by `Config.save()`.\n\n        See Also\n        --------\n        load_from_file : Load (and set) Config options from a JSON file.\n        save : Save the current set of Config options as a JSON string or file.\n        \"\"\"\n        try:","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/config.py#L368-L404","documentation":"Raised when Config._set_config_params receives an option name that does not correspond to any attribute/method on the Config class (after trying the set_ prefix). Polars Config options are exposed as set_* methods, so an unknown name is an AttributeError.","triggerScenarios":"Config(...some_option=...) or Config.load() with a JSON containing an unknown environment option — e.g. a typo like 'tblx_cell_max_length' or an option removed in a newer polars version.","commonSituations":"Typo'd keyword argument to Config(); loading a saved config saved from an older polars version whose option names changed; passing names without their set_ equivalents when the attribute check fails.","solutions":["Check the exact option name against polars.Config docs (e.g. set_tbl_cell_max_length not tbl_cell_max_length)","Remove the unknown key from the saved JSON config string","Upgrade/downgrade polars so the option exists","Use getattr to probe availability: hasattr(polars.Config, 'set_' + name) before calling"],"exampleFix":"// before\npl.Config(tblx_cell_max_length=20)  # AttributeError\n// after\npl.Config(tbl_cell_max_length=20)","handlingStrategy":"validation","validationCode":"opt = 'tbl_cell_max_length'\nif not hasattr(pl.Config, f'set_{opt}'):\n    raise ValueError(f'unknown Config option: {opt}')","typeGuard":"def is_valid_config_option(name: str) -> bool:\n    return hasattr(pl.Config, name) or hasattr(pl.Config, f'set_{name}')","tryCatchPattern":"try:\n    pl.Config(**opts)\nexcept AttributeError as e:\n    logging.error('bad config option: %s', e)\n    raise","preventionTips":["Copy option names from current polars.Config docs","Version-pin polars when loading saved configs","Strip unknown keys from saved JSON before load"],"tags":["polars","config","typo"],"backgroundTag":"invalid-config-value","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}