{"record":{"id":"6c41ca666b00a11d","repo":"pola-rs/polars","slug":"strict-cannot-be-used-with-how-horizontal-exte","errorCode":null,"errorMessage":"`strict` cannot be used with `how='horizontal_extend'`","messagePattern":"`strict` cannot be used with `how='horizontal_extend'`","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/functions/eager.py","lineNumber":57,"sourceCode":"            case None:\n                return \"horizontal\"\n            case True:\n                issue_deprecation_warning(\n                    f\"the `strict` parameter for `{function_name}` is deprecated. \"\n                    \"`how='horizontal'` already requires equal heights; omit `strict`.\",\n                    version=\"2.0.0\",\n                )\n                return \"horizontal\"\n            case False:\n                msg = (\n                    \"`strict=False` is no longer supported for `how='horizontal'`. \"\n                    \"Use `how='horizontal_extend'` to pad shorter frames with `null`.\"\n                )\n                raise ValueError(msg)\n\n    if how == \"horizontal_extend\" and strict is not None:\n        msg = \"`strict` cannot be used with `how='horizontal_extend'`\"\n        raise ValueError(msg)\n\n    return how\n\n\ndef concat(\n    items: Iterable[PolarsType],\n    *,\n    how: ConcatMethod = \"vertical\",\n    rechunk: bool = False,\n    parallel: bool = True,\n    strict: bool | None = None,\n) -> PolarsType:\n    \"\"\"\n    Combine multiple DataFrames, LazyFrames, or Series into a single object.\n\n    Parameters\n    ----------\n    items","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/functions/eager.py#L39-L75","documentation":"`pl.concat` with `how='horizontal_extend'` pads shorter frames with nulls, and the padding behavior is inherently non-strict, so the `strict` parameter has no meaningful value there. Polars raises this ValueError in `_normalize_horizontal_concat` to stop ambiguous combinations instead of silently ignoring `strict`.","triggerScenarios":"Calling `pl.concat(frames, how='horizontal_extend', strict=True)` (or `strict=False`) — any non-None `strict` combined with `how='horizontal_extend'` raises immediately, before any frame inspection.","commonSituations":"Code that worked with `how='horizontal'` and `strict=False` (which historically allowed mismatched column sets) migrated to `'horizontal_extend'` while keeping the `strict` argument; also arises after upgrading Polars where `strict` was newly added to horizontal concat.","solutions":["Remove the `strict` argument when using `how='horizontal_extend'`","If strict column matching is needed, use `how='horizontal'` instead","If null-padding lenient behavior is needed, just use `how='horizontal_extend'` alone"],"exampleFix":"// before\npl.concat([df1, df2], how='horizontal_extend', strict=False)\n// after\npl.concat([df1, df2], how='horizontal_extend')","handlingStrategy":"validation","validationCode":"if how == 'horizontal_extend' and strict is not None:\n    raise ValueError(\"strict cannot be used with how='horizontal_extend'\")","typeGuard":"def is_valid_combo(how: str, strict: bool | None) -> bool:\n    return not (how == 'horizontal_extend' and strict is not None)","tryCatchPattern":"try:\n    out = pl.concat(frames, how='horizontal_extend', strict=strict)\nexcept ValueError as e:\n    if 'strict' in str(e):\n        out = pl.concat(frames, how='horizontal_extend')\n    else:\n        raise","preventionTips":["Never pass `strict` together with 'horizontal_extend'","Centralize concat calls in a helper that normalizes arguments","Pin Polars version and read changelog when `strict` semantics change"],"tags":["polars","dataframe","concat","invalid-argument-value"],"backgroundTag":"conflicting-config-options","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}