{"record":{"id":"e4566bb32d7ce9cb","repo":"pathwaycom/pathway","slug":"universes-of-all-arguments-of-table-from-columns","errorCode":null,"errorMessage":"Universes of all arguments of Table.from_columns() have to be equal.\nConsider using Table.promise_universes_are_equal() to assert it.\n(However, untrue assertion might result in runtime errors.)","messagePattern":"Universes of all arguments of Table\\.from_columns\\(\\) have to be equal\\.\nConsider using Table\\.promise_universes_are_equal\\(\\) to assert it\\.\n\\(However, untrue assertion might result in runtime errors\\.\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/table.py","lineNumber":306,"sourceCode":"\n        >>> import pathway as pw\n        >>> t1 = pw.Table.empty(age=float, pet=float)\n        >>> t2 = pw.Table.empty(foo=float, bar=float).with_universe_of(t1)\n        >>> t3 = pw.Table.from_columns(t1.pet, qux=t2.foo)\n        >>> pw.debug.compute_and_print(t3, include_id=False)\n        pet | qux\n        \"\"\"\n        all_args = cast(\n            dict[str, expr.ColumnReference], combine_args_kwargs(args, kwargs)\n        )\n        if not all_args:\n            raise ValueError(\"Table.from_columns() cannot have empty arguments list\")\n        else:\n            arg = next(iter(all_args.values()))\n            table: Table = arg.table\n            for arg in all_args.values():\n                if not table._universe.is_equal_to(arg.table._universe):\n                    raise ValueError(\n                        \"Universes of all arguments of Table.from_columns() have to be equal.\\n\"\n                        + \"Consider using Table.promise_universes_are_equal() to assert it.\\n\"\n                        + \"(However, untrue assertion might result in runtime errors.)\"\n                    )\n            return table.select(*args, **kwargs)\n\n    @trace_user_frame\n    @check_arg_types\n    def concat_reindex(self, *tables: Table) -> Table:\n        \"\"\"Concatenate contents of several tables.\n\n        This is similar to PySpark union. All tables must have the same schema. Each row is reindexed.\n\n        Args:\n            tables: List of tables to concatenate. All tables must have the same schema.\n\n        Returns:\n            Table: The concatenated table. It will have new, synthetic ids.","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/table.py#L288-L324","documentation":"from_columns selects all passed columns from the universe of the first argument's table, so every argument must share the same universe (same set of row ids). The code takes the first column's table and compares universes with each other argument via Universe.is_equal_to; any mismatch raises ValueError with guidance to use Table.promise_universes_are_equal().","triggerScenarios":"pw.Table.from_columns(t1.a, t2.b) where t1 and t2 have different row-id sets — e.g. one was filtered, joined, or reindexed; combining columns from tables produced by different connectors or sources.","commonSituations":"Assembling wide tables from independently computed intermediate results; after a filter/restrict on one table but not the other; tables from different inputs that merely happen to have the same row count.","solutions":["Align universes explicitly with with_universe_of(): t2 = t2.with_universe_of(t1) before combining","If you can guarantee the ids are truly identical, assert it with pw.Table.promise_universes_are_equal(t1, t2) (runtime errors if the promise is false)","Re-derive both tables from a common source so universes match by construction"],"exampleFix":"# before\nt = pw.Table.from_columns(t1.a, qux=t2.b)  # universes differ -> ValueError\n\n# after\nt2_aligned = t2.with_universe_of(t1)\nt = pw.Table.from_columns(t1.a, qux=t2_aligned.b)","handlingStrategy":"validation","validationCode":"def same_universe(t1, t2) -> bool:\n    return t1._universe.is_equal_to(t2._universe)","typeGuard":"import pathway as pw\n\ndef tables_share_universe(t1: pw.Table, t2: pw.Table) -> bool:\n    return t1._universe.is_equal_to(t2._universe)","tryCatchPattern":null,"preventionTips":["Align universes with with_universe_of before combining columns","Derive combined tables from a single common base table"],"tags":["universe","api-misuse","pathway"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}