{"record":{"id":"b67523bf5b8a80bc","repo":"pathwaycom/pathway","slug":"how-argument-of-join-should-be-one-of-joinmode-inn","errorCode":null,"errorMessage":"How argument of join should be one of JoinMode.INNER, JoinMode.LEFT, JoinMode.RIGHT or JoinMode.OUTER values.","messagePattern":"How argument of join should be one of JoinMode\\.INNER, JoinMode\\.LEFT, JoinMode\\.RIGHT or JoinMode\\.OUTER values\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/arg_handlers.py","lineNumber":93,"sourceCode":"        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\n        if \"id\" in kwargs:\n            id = kwargs.pop(\"id\")\n            processed_kwargs[\"id\"] = id\n            if not allow_id:\n                raise ValueError(\n                    \"Received `id` argument but was not expecting any.\\n\"\n                    + \"Not every join type supports `id` argument.\"\n                )\n            elif id is None:\n                pass\n            elif isinstance(id, str):\n                raise ValueError(\n                    \"Received `id` argument of join that is a string.\\n\"\n                    + f\"Did you mean <table>.{id}\"","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/arg_handlers.py#L75-L111","documentation":"The 'how' argument of generic joins must be a JoinMode enum value. This branch catches objects that are neither JoinMode nor str — e.g. an int, a lambda, None, or a custom mode object. It complements the string check: strings get a dedicated hint, everything else gets this generic ValueError.","triggerScenarios":"how=0 or how=1 (indexing into a mental list of modes); how=None passed explicitly; how='left'.lower() style chained objects; passing a pandas join type constant.","commonSituations":"Porting numeric join-type codes from another framework; partially-initialized variables passed as how; refactors where how was computed but the fallback became None.","solutions":["Replace the value with a JoinMode member: how=pw.JoinMode.INNER/LEFT/RIGHT/OUTER.","If the mode comes from external data, validate and map it to JoinMode before the join call.","Prefer the dedicated join_* methods to avoid passing how entirely."],"exampleFix":"# before\nmode = 0  # meant 'inner'\nt1.join(t2, t1.k == t2.k, how=mode)\n\n# after\nmode = {0: pw.JoinMode.INNER, 1: pw.JoinMode.LEFT}[code]\nt1.join(t2, t1.k == t2.k, how=mode)","handlingStrategy":"type-guard","validationCode":"import pathway as pw\n\nassert isinstance(how, pw.JoinMode), f\"how must be a pw.JoinMode, got {type(how).__name__}\"\nt1.join(t2, *on, how=how)","typeGuard":"import pathway as pw\n\ndef is_join_mode(v) -> bool:\n    return isinstance(v, pw.JoinMode)","tryCatchPattern":null,"preventionTips":["Always construct how from pw.JoinMode members, not codes or None.","Validate external inputs mapped to how before the join call."],"tags":["join","api-misuse","enum"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}