{"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":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/functions/eager.py","lineNumber":59,"sourceCode":"                \"is deprecated and will require equal heights in the next breaking \"\n                \"release. \"\n                \"Use `how='horizontal_extend'` to keep the current behavior.\",\n                version=\"1.42.1\",\n            )\n            return \"horizontal_extend\"\n        elif strict is False:\n            issue_deprecation_warning(\n                f\"the `strict` parameter for `{function_name}` is deprecated. \"\n                \"Use `how='horizontal_extend'` instead.\",\n                version=\"1.42.1\",\n            )\n            return \"horizontal_extend\"\n        else:\n            return \"horizontal\"\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":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/functions/eager.py#L41-L77","documentation":"In pl.concat, the deprecated boolean strict parameter is a legacy alias that maps to how='horizontal_extend'. Specifying both strict and how='horizontal_extend' is contradictory and raises ValueError before any concat work happens. The deprecation shim (strict=False maps to horizontal_extend) only applies when how is left at its default.","triggerScenarios":"pl.concat(dfs, how='horizontal_extend', strict=False) — typically half-migrated code that sets the new how but still forwards the old flag; shared wrapper functions that pass **kwargs containing strict into concat.","commonSituations":"Upgrades around Polars 1.42.1 where strict was deprecated; kwargs-forwarding helpers; copy-paste blending old and new call signatures; defaults like strict=None meaning 'unset' being replaced by a real False.","solutions":["Remove strict and keep only how='horizontal_extend'","Or, on the legacy path, pass only strict=False and let it map to horizontal_extend","Audit wrapper functions that forward **kwargs to concat and strip/clean strict there","Use strict=None (or omit it) to mean 'not specified' when you must forward the parameter"],"exampleFix":"# before\npl.concat(dfs, how='horizontal_extend', strict=False)\n\n# after\npl.concat(dfs, how='horizontal_extend')\n# legacy equivalent (deprecated):\npl.concat(dfs, strict=False)","handlingStrategy":"validation","validationCode":"if how == 'horizontal_extend':\n    strict = None  # must not be set alongside how\nif strict is not None and how != 'vertical':\n    # decide: legacy path or new path, never both\n    how, strict = ('horizontal_extend', None) if strict is False else (how, None)\nout = pl.concat(items, how=how, strict=strict)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Migrate fully off deprecated flags before adding the new parameter","Strip deprecated keys in wrapper functions that forward **kwargs","Treat deprecation warnings as failures in CI so half-migrated calls surface early"],"tags":["polars","concat","valueerror","deprecated","api-migration"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}