{"record":{"id":"c5703b5894463540","repo":"pola-rs/polars","slug":"use-of-how-outer-coalesce-should-be-replaced-w","errorCode":null,"errorMessage":"use of `how='outer_coalesce'` should be replaced with `how='full', coalesce=True`.","messagePattern":"use of `how='outer_coalesce'` should be replaced with `how='full', coalesce=True`\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/lazyframe/frame.py","lineNumber":6233,"sourceCode":"        require_same_type(self, other)\n\n        if maintain_order is None:\n            maintain_order = \"none\"\n\n        uses_on = on is not None\n        uses_left_on = left_on is not None\n        uses_right_on = right_on is not None\n        uses_lr_on = uses_left_on or uses_right_on\n        if uses_on and uses_lr_on:\n            msg = \"cannot use 'on' in conjunction with 'left_on' or 'right_on'\"\n            raise ValueError(msg)\n        elif uses_left_on != uses_right_on:\n            msg = \"'left_on' requires corresponding 'right_on'\"\n            raise ValueError(msg)\n\n        if how == \"outer\":  # type: ignore[comparison-overlap]\n            msg = \"use of `how='outer'` should be replaced with `how='full'`.\"\n            raise ValueError(msg)\n        elif how == \"outer_coalesce\":  # type: ignore[comparison-overlap]\n            msg = \"use of `how='outer_coalesce'` should be replaced with `how='full', coalesce=True`.\"\n            raise ValueError(msg)\n        elif how == \"cross\":\n            if uses_on or uses_lr_on:\n                msg = \"cross join should not pass join keys\"\n                raise ValueError(msg)\n            return self._from_pyldf(\n                self._ldf.join(\n                    other._ldf,\n                    [],\n                    [],\n                    allow_parallel,\n                    force_parallel,\n                    nulls_equal,\n                    how,\n                    suffix,\n                    validate,","sourceCodeStart":6215,"sourceCodeEnd":6251,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/lazyframe/frame.py#L6215-L6251","documentation":"Deprecation/removal guard in LazyFrame.join for the legacy 'outer_coalesce' strategy. Coalescing join keys is now controlled by an explicit `coalesce` parameter rather than a separate how value, so how='outer_coalesce' is rejected with instructions to use how='full', coalesce=True instead.","triggerScenarios":"Calling lf.join(other, on='id', how='outer_coalesce') on a Polars version where this strategy alias was removed (post-1.0 rename of outer joins to full joins).","commonSituations":"Code written between the 'outer_coalesce' introduction and its removal, then run on a newer Polars; migration scripts updated only partially from 'outer' to 'outer_coalesce'.","solutions":["Replace how='outer_coalesce' with how='full', coalesce=True","Audit codebases for remaining 'outer'/'outer_coalesce' join strategies after upgrading Polars"],"exampleFix":"// before\ndf.join(other, on='id', how='outer_coalesce')\n// after\ndf.join(other, on='id', how='full', coalesce=True)","handlingStrategy":"validation","validationCode":"def normalize_how(how, coalesce=None):\n    if how == 'outer_coalesce':\n        return 'full', True\n    if how == 'outer':\n        return 'full', coalesce\n    return how, coalesce","typeGuard":"def is_modern_strategy(how) -> bool:\n    return how not in ('outer', 'outer_coalesce')","tryCatchPattern":"try:\n    out = df.join(other, on='id', how=how)\nexcept ValueError as e:\n    if 'outer_coalesce' in str(e):\n        out = df.join(other, on='id', how='full', coalesce=True)\n    else:\n        raise","preventionTips":["Map legacy strategies to modern ones at one boundary function","Grep for 'outer_coalesce' when upgrading","Prefer explicit how='full', coalesce=True in new code"],"tags":["polars","python","join","deprecation","version-upgrade"],"backgroundTag":"deprecated-api-usage","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"}