{"record":{"id":"e8309e81fff336db","repo":"pathwaycom/pathway","slug":"columns-do-not-match-in-the-argument-of-table-conc","errorCode":null,"errorMessage":"columns do not match in the argument of Table.concat(). Missing columns: {missing_keys}. Superfluous columns: {superfluous_keys}.","messagePattern":"columns do not match in the argument of Table\\.concat\\(\\)\\. Missing columns: (.+?)\\. Superfluous columns: (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/table.py","lineNumber":1635,"sourceCode":"        ... 12 | 12  | Tom   | 40\n        ... ''')\n        >>> pw.universes.promise_are_pairwise_disjoint(t1, t2)\n        >>> t3 = t1.concat(t2)\n        >>> pw.debug.compute_and_print(t3, include_id=False)\n        age | owner | pet\n        8   | Alice | 2\n        9   | Bob   | 1\n        10  | Alice | 1\n        11  | Alice | 30\n        12  | Tom   | 40\n        \"\"\"\n        for other in others:\n            if other.keys() != self.keys():\n                self_keys = set(self.keys())\n                other_keys = set(other.keys())\n                missing_keys = self_keys - other_keys\n                superfluous_keys = other_keys - self_keys\n                raise ValueError(\n                    \"columns do not match in the argument of Table.concat().\"\n                    + (\n                        f\" Missing columns: {missing_keys}.\"\n                        if missing_keys is not None\n                        else \"\"\n                    )\n                    + (\n                        f\" Superfluous columns: {superfluous_keys}.\"\n                        if superfluous_keys is not None\n                        else \"\"\n                    )\n                )\n        schema = {}\n        all_args: list[Table] = [self, *others]\n\n        for key in self.keys():\n            schema[key] = _types_lca_with_error(\n                *[arg.schema._dtypes()[key] for arg in all_args],","sourceCodeStart":1617,"sourceCodeEnd":1653,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/table.py#L1617-L1653","documentation":"Raised by Table.concat() (via the public concat path) when an argument table's column set differs from self's. concat stacks tables vertically, so every table must expose exactly the same column names before ids are unioned. The error lists which columns are missing and which are superfluous.","triggerScenarios":"pw.Table.concat(t1, t2) (or t1.concat(t2)) where t2.keys() != t1.keys(); e.g. t2 has an extra 'timestamp' column or lacks 'age'.","commonSituations":"Concatenating outputs of different connectors or API responses whose schemas drifted; one branch of a pipeline added a derived column; renamed columns on one table only.","solutions":["Project both tables to a common column set: t2 = t2.select(*t1.keys()) or t2.select(t1.colA, t1.colB)","Rename mismatched columns first with t2 = t2.rename(correct='wrong') so key sets match","Add missing constant columns: t2 = t2.with_columns(dummy=pw.const(None)) to fill gaps","Check schemas before concat: assert set(t1.keys()) == set(t2.keys())"],"exampleFix":"# before\nt3 = pw.Table.concat(t1, t2)  # t2 has extra column 'ts'\n\n# after\nt3 = pw.Table.concat(t1, t2.select(*t1.keys()))","handlingStrategy":"validation","validationCode":"def concat_safe(t1, t2):\n    assert set(t1.keys()) == set(t2.keys()), (\n        f'missing={set(t1.keys())-set(t2.keys())} '\n        f'superfluous={set(t2.keys())-set(t1.keys())}'\n    )\n    return pw.Table.concat(t1, t2)","typeGuard":null,"tryCatchPattern":"try:\n    t3 = pw.Table.concat(t1, t2)\nexcept ValueError as e:\n    if 'columns do not match' in str(e):\n        t3 = pw.Table.concat(t1, t2.select(*t1.keys()))","preventionTips":["Define one shared Schema class for all concat branches","Assert key-set equality in pipeline setup","Project to the target column set right before concat"],"tags":["pathway","schema","table-concat","columns"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}