{"record":{"id":"c39dc4b28cab39f0","repo":"pola-rs/polars","slug":"unrecognised-deprecation-type-tp-r-nexpected-on","errorCode":null,"errorMessage":"unrecognised deprecation type {tp!r}.\\nExpected one (or more) of {repr(sorted(valid_types))[1:-1]}","messagePattern":"unrecognised deprecation type (.+?)\\.\\\\nExpected one \\(or more\\) of (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/_utils/deprecation.py","lineNumber":339,"sourceCode":"            - \"function\"\n            - \"renamed_parameter\"\n            - \"nonkeyword_arguments\"\n            - \"parameter_as_multi_positional\"\n\n    Examples\n    --------\n    >>> from polars._utils.deprecation import identify_deprecations\n    >>> identify_deprecations(\"nonkeyword_arguments\")  # doctest: +IGNORE_RESULT\n    {'nonkeyword_arguments': ['functions.business.business_day_count']}\n    \"\"\"\n    valid_types = set(get_args(DeprecationType))\n    for tp in types:\n        if tp not in valid_types:\n            msg = (\n                f\"unrecognised deprecation type {tp!r}.\\n\"\n                f\"Expected one (or more) of {repr(sorted(valid_types))[1:-1]}\"\n            )\n            raise ValueError(msg)\n\n    package_path = Path(sys.modules[\"polars\"].__file__).parent  # type: ignore[arg-type]\n    results = defaultdict(list)\n\n    for py_file in package_path.rglob(\"*.py\"):\n        rel_path = py_file.relative_to(package_path)\n        module_path = \".\".join(rel_path.parts).removesuffix(\".py\")\n        with py_file.open(\"r\", encoding=\"utf-8\") as src:\n            for deprecation_type, func_names in _find_deprecated_functions(\n                source=src.read(),\n                module_path=module_path,\n            ).items():\n                if deprecation_type not in valid_types:\n                    # note: raising here implies we have a new deprecation function\n                    # that should be added to the DeprecationType type alias\n                    msg = f\"unrecognised deprecation type {tp!r}.\\n\"\n                    raise ValueError(msg)\n","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/pola-rs/polars/blob/5d8ebabf11caea54a5c29178a64a058762f49766/py-polars/src/polars/_utils/deprecation.py#L321-L357","documentation":"Validation inside identify_deprecations: one of the strings in `types` is not a member of the DeprecationType literal ('function', 'renamed_parameter', 'nonkeyword_arguments', 'parameter_as_multi_positional', ...). The invalid type string is the faulty input.","triggerScenarios":"Internal deprecation helper received an unknown deprecation type.","commonSituations":"See trigger scenarios.","solutions":["Use a valid deprecation type among the listed valid_types."],"exampleFix":"deprecate(..., types=('param',))","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5d8ebabf11caea54a5c29178a64a058762f49766","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}