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

  1. Remove the argument from the call
  2. Read the hint in the error for the recommended alternative behavior
  3. 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

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


AI-assisted analysis of pola-rs/polars@5d8ebabf11 (2026-08-28). Data as JSON: /api/errors/b542aa314d90dbb2. Report an issue: GitHub.