{"record":{"id":"a185f44f537f7106","repo":"pathwaycom/pathway","slug":"received-how-argument-but-was-not-expecting-any","errorCode":null,"errorMessage":"Received `how` argument but was not expecting any.\nConsider using a generic join method that handles `how` to decide on a type of a join to be used.","messagePattern":"Received `how` argument but was not expecting any\\.\nConsider using a generic join method that handles `how` to decide on a type of a join to be used\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/arg_handlers.py","lineNumber":79,"sourceCode":"        raise ValueError(\n            \"Table.windowby() received extra kwargs.\\n\"\n            + \"You probably want to use Table.windowby(...).reduce(**kwargs) to compute output columns.\"\n        )\n    return (self, time_expr), {\n        \"window\": window,\n        \"behavior\": behavior,\n        \"instance\": instance,\n    }\n\n\ndef join_kwargs_handler(*, allow_how: bool, allow_id: bool):\n    def handler(self, other, *on, **kwargs):\n        processed_kwargs = {}\n        if \"how\" in kwargs:\n            how = kwargs.pop(\"how\")\n            processed_kwargs[\"how\"] = how\n            if not allow_how:\n                raise ValueError(\n                    \"Received `how` argument but was not expecting any.\\n\"\n                    + \"Consider using a generic join method that handles `how` \"\n                    + \"to decide on a type of a join to be used.\"\n                )\n            elif isinstance(how, JoinMode):\n                pass\n            elif isinstance(how, str):\n                raise ValueError(\n                    \"Received `how` argument of join that is a string.\\n\"\n                    + \"You probably want to use one of \"\n                    + \"JoinMode.INNER, JoinMode.LEFT, JoinMode.RIGHT or JoinMode.OUTER values.\"\n                )\n            else:\n                raise ValueError(\n                    \"How argument of join should be one of \"\n                    + \"JoinMode.INNER, JoinMode.LEFT, JoinMode.RIGHT or JoinMode.OUTER values.\"\n                )\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/arg_handlers.py#L61-L97","documentation":"Pathway splits join APIs into specific methods (join, join_left, join_right, join_outer, join_any, ...) that do not take a 'how' parameter, and generic methods (join_by / the generic entry points) that do. This handler runs with allow_how=False, so passing how=... to a specific join method raises this ValueError pointing you to the generic method. The check happens in the shared kwargs handler used by Table join methods.","triggerScenarios":"t1.join_left(t2, t1.k == t2.k, how='left'); t1.join_inner(t2, how=pw.JoinMode.LEFT); any specific-arity join call that includes how.","commonSituations":"Copy-pasting from generic join examples into specific methods; pandas/sql habits where every join takes how=; refactoring from join(...how=...) to join_left and leaving the kwarg behind.","solutions":["Drop the how kwarg from the specific method: t.join_left(t2, t1.k == t2.k).","Or switch to the generic form that accepts how: t.join(t2, t1.k == t2.k, how=pw.JoinMode.LEFT) via the generic entry point.","Pick the method matching the intended mode: join_inner/join_left/join_right/join_outer."],"exampleFix":"# before\nt1.join_left(t2, t1.k == t2.k, how=\"left\")\n\n# after\nt1.join_left(t2, t1.k == t2.k)","handlingStrategy":"validation","validationCode":"def join_left_checked(t1, t2, *on, **kwargs):\n    if \"how\" in kwargs:\n        raise TypeError(\"join_left does not accept how; the method already fixes the mode\")\n    return t1.join_left(t2, *on, **kwargs)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Specific join methods (join_inner/join_left/...) encode the mode in their name — never pass how.","If you want config-driven modes, use the generic join with a JoinMode value."],"tags":["join","api-misuse","kwargs"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}