{"record":{"id":"b558643ef41c7017","repo":"pathwaycom/pathway","slug":"universes-of-all-arguments-of-table-add-have","errorCode":null,"errorMessage":"Universes of all arguments of Table.__add__() 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\\.__add__\\(\\) 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":467,"sourceCode":"        >>> import pathway as pw\n        >>> t1 = pw.debug.table_from_markdown('''\n        ...    pet\n        ... 1  Dog\n        ... 7  Cat\n        ... ''')\n        >>> t2 = pw.debug.table_from_markdown('''\n        ...    age\n        ... 1   10\n        ... 7    3\n        ... ''')\n        >>> t3 = t1 + t2\n        >>> pw.debug.compute_and_print(t3, include_id=False)\n        pet | age\n        Cat | 3\n        Dog | 10\n        \"\"\"\n        if not self._universe.is_equal_to(other._universe):\n            raise ValueError(\n                \"Universes of all arguments of Table.__add__() 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 self.select(*self, *other)\n\n    @property\n    def slice(self) -> TableSlice:\n        \"\"\"Creates a collection of references to self columns.\n        Supports basic column manipulation methods.\n\n        Example:\n\n        >>> import pathway as pw\n        >>> t1 = pw.debug.table_from_markdown('''\n        ... age | owner | pet\n        ... 10  | Alice | dog\n        ... 9   | Bob   | dog","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/table.py#L449-L485","documentation":"Table.__add__ (the + operator) horizontally concatenates two tables and is implemented as self.select(*self, *other), which requires both tables to have exactly equal universes. self._universe.is_equal_to(other._universe) is checked first; on mismatch ValueError is raised with a pointer to Table.promise_universes_are_equal().","triggerScenarios":"t3 = t1 + t2 where t1 and t2 have different row-id sets — one filtered, the result of an outer join, a table with an index column, or different connectors producing different ids.","commonSituations":"Merging feature columns computed in separate pipeline branches; adding a column derived after a filter; combining tables from markdown/debug fixtures whose implicit ids differ.","solutions":["Bring both to the same universe: t2 = t2.with_universe_of(t1) (or derive both from a common base table) before t1 + t2","If ids are provably identical, use pw.Table.promise_universes_are_equal(t1, t2) — note a false promise causes runtime errors","Prefer t1.with_columns(...) or a join keyed on id when the tables come from different sources"],"exampleFix":"# before\nt3 = t1 + t2  # ValueError: universes not equal\n\n# after\nt3 = t1 + t2.with_universe_of(t1)","handlingStrategy":"validation","validationCode":"def can_add(t1, t2) -> bool:\n    return t1._universe.is_equal_to(t2._universe)","typeGuard":"import pathway as pw\n\ndef addable(t1: pw.Table, t2: pw.Table) -> bool:\n    return t1._universe.is_equal_to(t2._universe)","tryCatchPattern":null,"preventionTips":["Check universes match before using + on tables from different branches","Use with_universe_of to align after filters or reindexing"],"tags":["universe","operator","pathway"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}