pola-rs/polars · error · ValueError

`strict=False` is no longer supported for…

Error message

`strict=False` is no longer supported for `how='horizontal'`. Use `how='horizontal_extend'` to pad shorter frames with `null`.

What it means

When concatenating frames with how='horizontal', `strict=False` (padding shorter frames with nulls) was deprecated and removed. polars now raises ValueError and directs users to how='horizontal_extend', which encodes that behavior explicitly.

Solutions

  1. Replace `strict=False` with `how='horizontal_extend'`
  2. Remove the `strict` argument entirely if default (strict=True) behavior is fine
  3. Note that `strict` cannot be combined with 'horizontal_extend'

Example fix

// before
pl.concat([df1, df2], how='horizontal', strict=False)
// after
pl.concat([df1, df2], how='horizontal_extend')
Defensive patterns

Strategy: try-catch

Validate before calling

if how == 'horizontal' and strict is False:
    how = 'horizontal_extend'
    strict = None

Try / catch

try:
    out = pl.concat(frames, how='horizontal', strict=strict)
except ValueError:
    out = pl.concat(frames, how='horizontal_extend')

Prevention

When it happens

Trigger: Calling `pl.concat([df1, df2], how='horizontal', strict=False)` after upgrading polars; code with `strict=strict` passed through from a config flag set to False.

Common situations: Version upgrade breaking previously working concat calls; library code forwarding a strict parameter to concat.

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/738c2ba4d5fbff72. Report an issue: GitHub.

Appendix: source

Thrown at py-polars/src/polars/functions/eager.py:53

) -> ConcatMethod:
    """Normalize deprecated horizontal concat arguments."""
    if how == "horizontal":
        match strict:
            case None:
                return "horizontal"
            case True:
                issue_deprecation_warning(
                    f"the `strict` parameter for `{function_name}` is deprecated. "
                    "`how='horizontal'` already requires equal heights; omit `strict`.",
                    version="2.0.0",
                )
                return "horizontal"
            case False:
                msg = (
                    "`strict=False` is no longer supported for `how='horizontal'`. "
                    "Use `how='horizontal_extend'` to pad shorter frames with `null`."
                )
                raise ValueError(msg)

    if how == "horizontal_extend" and strict is not None:
        msg = "`strict` cannot be used with `how='horizontal_extend'`"
        raise ValueError(msg)

    return how


def concat(
    items: Iterable[PolarsType],
    *,
    how: ConcatMethod = "vertical",
    rechunk: bool = False,
    parallel: bool = True,
    strict: bool | None = None,
) -> PolarsType:
    """
    Combine multiple DataFrames, LazyFrames, or Series into a single object.

View on GitHub (pinned to fe841f959e)