{"record":{"id":"af5659d46e515b39","repo":"pola-rs/polars","slug":"how-must-be-one-of-left-inner-full-fo","errorCode":null,"errorMessage":"`how` must be one of {'left', 'inner', 'full'}; found {how!r}","messagePattern":"`how` must be one of (.+?); found (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/lazyframe/frame.py","lineNumber":9037,"sourceCode":"        │ --- ┆ ---  │\n        │ i64 ┆ i64  │\n        ╞═════╪══════╡\n        │ 1   ┆ -99  │\n        │ 2   ┆ 500  │\n        │ 3   ┆ null │\n        │ 4   ┆ 700  │\n        │ 5   ┆ -66  │\n        └─────┴──────┘\n        \"\"\"\n        require_same_type(self, other)\n\n        if how in {\"outer\", \"outer_coalesce\"}:  # type: ignore[comparison-overlap]\n            msg = f\"use of `how='{how}'` should be replaced with `how='full'`.\"\n            raise ValueError(msg)\n\n        if how not in (\"left\", \"inner\", \"full\"):\n            msg = f\"`how` must be one of {{'left', 'inner', 'full'}}; found {how!r}\"\n            raise ValueError(msg)\n\n        row_index_name = None\n        if on is None:\n            if left_on is None and right_on is None:\n                # no keys provided--use row index\n                row_index_name = \"__POLARS_ROW_INDEX\"\n                self = self.with_row_index(row_index_name)\n                other = other.with_row_index(row_index_name)\n                left_on = right_on = [row_index_name]\n            else:\n                # one of left or right is missing, raise error\n                if left_on is None:\n                    msg = \"missing join columns for left frame\"\n                    raise ValueError(msg)\n                if right_on is None:\n                    msg = \"missing join columns for right frame\"\n                    raise ValueError(msg)\n        else:","sourceCodeStart":9019,"sourceCodeEnd":9055,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/lazyframe/frame.py#L9019-L9055","documentation":"Raised as a ValueError when the `how` argument of this join is not one of the allowed strategies 'left', 'inner', or 'full'. This is fail-fast validation of the join strategy string before any execution.","triggerScenarios":"Calling `lf.join(other, on=\"id\", how=\"semi\")` or any misspelled value like \"inner_join\", \"OUTER\", or \"leftouter\" on this API.","commonSituations":"Copying pandas merge `how` values; typos; assuming other polars join strategies ('semi', 'anti', 'cross') are accepted by this particular method.","solutions":["Use one of: 'left', 'inner', 'full'.","Check the method's docstring — this API supports only this subset.","Use the dedicated `join`/`join_asof` methods for other strategies."],"exampleFix":"// before\nlf.join(other, on=\"id\", how=\"leftouter\")\n// after\nlf.join(other, on=\"id\", how=\"left\")","handlingStrategy":"validation","validationCode":"_VALID_HOW = {\"left\", \"inner\", \"full\"}\nif how not in _VALID_HOW:\n    raise ValueError(f\"how must be one of {sorted(_VALID_HOW)}; got {how!r}\")\nout = lf.join(other, on=\"id\", how=how)","typeGuard":null,"tryCatchPattern":"try:\n    out = lf.join(other, on=key, how=how)\nexcept ValueError as e:\n    if \"`how` must be one of\" in str(e):\n        out = lf.join(other, on=key, how=\"inner\")\n    else:\n        raise","preventionTips":["Define join strategies as an enum/Literal type in shared code.","Check this method's docstring — it supports a narrower set than pl.LazyFrame.join.","Sanitize how values coming from config/CLI before use."],"tags":["python","polars","join","invalid-argument"],"backgroundTag":"invalid-enum-value","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"}