{"record":{"id":"beefecc7b44dae5c","repo":"pola-rs/polars","slug":"missing-join-columns-for-right-frame","errorCode":null,"errorMessage":"missing join columns for right frame","messagePattern":"missing join columns for right frame","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/lazyframe/frame.py","lineNumber":9386,"sourceCode":"            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:\n            # move on into left/right_on to simplify logic\n            left_on = right_on = on\n\n        if isinstance(left_on, str):\n            left_on = [left_on]\n        if isinstance(right_on, str):\n            right_on = [right_on]\n\n        left_schema = self.collect_schema()\n        for name in left_on:\n            if name not in left_schema:\n                msg = f\"left join column {name!r} not found\"\n                raise ValueError(msg)\n        right_schema = other.collect_schema()\n        for name in right_on:\n            if name not in right_schema:\n                msg = f\"right join column {name!r} not found\"","sourceCodeStart":9368,"sourceCodeEnd":9404,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/lazyframe/frame.py#L9368-L9404","documentation":"Mirror of the left-frame case: in LazyFrame.update with `on` None, if `left_on` is given but `right_on` is None, the right frame's key columns are unknown and ValueError('missing join columns for right frame') is raised.","triggerScenarios":"lf.update(other, left_on='key_l') with neither `on` nor `right_on`; programmatic calls that build kwargs and skip right_on.","commonSituations":"Half-finished refactors of join calls; key-mapping dicts that only define the left side.","solutions":["Provide both: lf.update(other, left_on='key_l', right_on='key_r')","Or use `on='key'` when key names match","Add a pre-call assertion in shared code that left_on/right_on are both set or both None"],"exampleFix":"// before\nlf.update(other, left_on='key_l')\n\n// after\nlf.update(other, left_on='key_l', right_on='key_r')","handlingStrategy":"validation","validationCode":"if on is None and ((left_on is None) != (right_on is None)):\n    raise ValueError('update needs `on`, or both `left_on` and `right_on`')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["left_on and right_on are a pair in update(); never pass one without the other"],"tags":["polars","update","join","missing-argument"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}