pola-rs/polars · error · ArgumentRemovedError
the argument {param.name!r} for {func_name!r}{was_deprecated
Error message
the argument {param.name!r} for {func_name!r}{was_deprecated_and} has been removed in version {param.removed_in}. What it means
Raised when a decorated polars function receives a parameter that was removed outright (not renamed). The message names the parameter, function, removal version, and an optional hint about what to do instead.
Source
Thrown at py-polars/src/polars/_utils/expired.py:158
f" {param.name!r}{was_deprecated_and} has been renamed to"
f" {param.new_name!r} in version {param.removed_in}."
)
raise ArgumentRemovedError(msg)
else:
msg = (
f"the argument {param.name!r} for {func_name!r}{was_deprecated_and}"
f" has been removed in version {param.removed_in}."
f" It was renamed to {param.new_name!r}."
)
msg = msg if param.hint is None else f"{msg} {param.hint}"
raise ArgumentRemovedError(msg)
elif isinstance(param, RemovedParameter):
msg = (
f"the argument {param.name!r} for {func_name!r}{was_deprecated_and}"
f" has been removed in version {param.removed_in}."
)
msg = msg if param.hint is None else f"{msg} {param.hint}"
raise ArgumentRemovedError(msg)
else:
msg = f"Unexpected parameter type: {type(param)!r}"
raise TypeError(msg)
View on GitHub (pinned to 5d8ebabf11)
Solutions
- Remove the argument from the call
- Read the hint in the error for the recommended alternative behavior
- Check the function's current signature via help() or the migration guide
Example fix
# before pl.concat([df1, df2], how='horizontal', strict=False) # after pl.concat([df1, df2], how='horizontal_extend')
Defensive patterns
Strategy: validation
Validate before calling
REMOVED = {'strict': 'horizontal_extend', 'copy': None}
for k in list(kwargs):
if k in REMOVED:
del kwargs[k] # or apply documented alternative Prevention
- Read the removal hint in the error and apply the alternative
- Track polars release notes for removed options
- Avoid carrying unused legacy options in shared config dicts
When it happens
Trigger: Passing a removed kwarg such as strict=False to functions where it was dropped, or copy=... where the option no longer exists — any RemovedParameter registered with the decorator's removed_parameters.
Common situations: Post-upgrade breakage where an option was eliminated because the behavior became unconditional or contradictory; code copied from old docs.
Related errors
- the argument {param.name!r} for {func_name!r}{was_deprecated
- `{name}` was removed in version {version}
- {func_name!r} received both {param.name!r} and {param.new_na
- `strict=False` is no longer supported for `how='horizontal'`
- the `dtypes` parameter for `read_csv` has been renamed to `s
AI-assisted analysis of pola-rs/polars@5d8ebabf11 (2026-08-28).
Data as JSON: /api/errors/b542aa314d90dbb2.
Report an issue: GitHub.