pola-rs/polars · error · ArgumentRemovedError

the argument for has been removed in version .

Error message

the argument {param.name!r} for {func_name!r}{was_deprecated_and} has been removed in version {param.removed_in}. {param.hint}

What it means

For a RemovedParameter (an argument deleted outright, not renamed), `wrapper` calls `_raise_removed_argument_error`, raising ArgumentRemovedError stating the argument was removed in the given version, with an optional migration hint appended.

Solutions

  1. Remove the obsolete keyword argument from the call
  2. Follow the error hint to any replacement behavior
  3. Filter legacy kwargs before splatting config dictionaries into API calls

Example fix

// before
pl.read_csv(f, low_memory=True)
// after
pl.read_csv(f)
Defensive patterns

Strategy: try-catch

Validate before calling

REMOVED = {"low_memory"}  # args removed without replacement
bad = REMOVED & kwargs.keys()
if bad:
    kwargs = {k: v for k, v in kwargs.items() if k not in REMOVED}

Try / catch

try:
    result = func(**cfg_kwargs)
except ArgumentRemovedError as e:
    logger.warning("dropping removed argument: %s", e)
    result = func(**{k: v for k, v in cfg_kwargs.items() if k != removed_name})

Prevention

When it happens

Trigger: Calling a decorated Polars function with a keyword that was fully removed, e.g. passing `low_memory=True` to a reader that no longer supports it.

Common situations: Upgrading Polars past an API-cleanup release; old example code; config files whose keys are splatted into function kwargs.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of pola-rs/polars@fe841f959e (2026-09-18). Data as JSON: /api/errors/9e58acca0952cf28. Report an issue: GitHub.

Appendix: 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 fe841f959e)