{"record":{"id":"6771e79306e312f9","repo":"pola-rs/polars","slug":"the-argument-param-name-r-for-func-name-r-was","errorCode":null,"errorMessage":"the argument {param.name!r} for {func_name!r}{was_deprecated_and} has been removed in version {param.removed_in}. It was renamed to {param.new_name!r}.","messagePattern":"the argument (.+?) for (.+?)(.+?) has been removed in version (.+?)\\. It was renamed to (.+?)\\.","errorType":"exception","errorClass":"ArgumentRemovedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/_utils/expired.py","lineNumber":151,"sourceCode":"        if param.deprecated_in is not None\n        else \"\"\n    )\n    if isinstance(param, RenamedParameter):\n        if param.name in kwargs and param.new_name in kwargs:\n            msg = (\n                f\"{func_name!r} received both {param.name!r} and {param.new_name!r} as arguments;\"\n                f\" {param.name!r}{was_deprecated_and} has been renamed to\"\n                f\" {param.new_name!r} in version {param.removed_in}.\"\n            )\n            raise ArgumentRemovedError(msg)\n        else:\n            msg = (\n                f\"the argument {param.name!r} for {func_name!r}{was_deprecated_and}\"\n                f\" has been removed in version {param.removed_in}.\"\n                f\" It was renamed to {param.new_name!r}.\"\n            )\n            msg = msg if param.hint is None else f\"{msg} {param.hint}\"\n            raise ArgumentRemovedError(msg)\n    elif isinstance(param, RemovedParameter):\n        msg = (\n            f\"the argument {param.name!r} for {func_name!r}{was_deprecated_and}\"\n            f\" has been removed in version {param.removed_in}.\"\n        )\n        msg = msg if param.hint is None else f\"{msg} {param.hint}\"\n        raise ArgumentRemovedError(msg)\n    else:\n        msg = f\"Unexpected parameter type: {type(param)!r}\"\n        raise TypeError(msg)\n","sourceCodeStart":133,"sourceCodeEnd":162,"githubUrl":"https://github.com/pola-rs/polars/blob/5d8ebabf11caea54a5c29178a64a058762f49766/py-polars/src/polars/_utils/expired.py#L133-L162","documentation":"Raised by polars' removed-parameter decorator when only the old (renamed) parameter name is passed to a function whose parameter has since been removed. The message states the removal version and the new name to use, plus any hint.","triggerScenarios":"Calling a decorated function with the old kwarg only, e.g. df.rolling_std('a', window_size=3, min_periods=2) after min_periods was removed in favor of min_samples.","commonSituations":"Old notebooks, tutorials, or un-migrated production code after a polars upgrade; CI failing after a dependency bump.","solutions":["Rename the argument to the new name given in the message","Apply a project-wide search-and-replace for the old parameter name","Update the polars pin in CI and re-run tests to find remaining call sites"],"exampleFix":"# before\ndf.rolling_std('a', window_size=3, min_periods=1)\n# after\ndf.rolling_std('a', window_size=3, min_samples=1)","handlingStrategy":"validation","validationCode":"RENAMES = {'min_periods': 'min_samples'}\nfor old, new in RENAMES.items():\n    if old in kwargs:\n        kwargs[new] = kwargs.pop(old)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a compatibility shim mapping old->new kwargs","Upgrade via the migration guide in one pass","Add smoke tests exercising each deprecated call site"],"tags":["python","polars","removed-parameter","migration","version"],"backgroundTag":"removed-parameter","analyzedSha":"5d8ebabf11caea54a5c29178a64a058762f49766","analyzedAt":"2026-08-28T18:02:35.179Z","contentChangedAt":"2026-08-28T18:02:35.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}