{"record":{"id":"7fff8bfd5d836228","repo":"pathwaycom/pathway","slug":"columns-of-the-argument-in-table-update-cells-no","errorCode":null,"errorMessage":"Columns of the argument in Table.update_cells() not present in the updated table: {list(names)}.","messagePattern":"Columns of the argument in Table\\.update_cells\\(\\) not present in the updated table: (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/table.py","lineNumber":1731,"sourceCode":"        ...   | age | owner | pet\n        ... 1 | 10  | Alice | 1\n        ... 2 | 9   | Bob   | 1\n        ... 3 | 8   | Alice | 2\n        ... ''')\n        >>> t2 = pw.debug.table_from_markdown('''\n        ...     age | owner | pet\n        ... 1 | 10  | Alice | 30\n        ... ''')\n        >>> pw.universes.promise_is_subset_of(t2, t1)\n        >>> t3 = t1.update_cells(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 | 30\n        \"\"\"\n        if names := (set(other.keys()) - set(self.keys())):\n            raise ValueError(\n                f\"Columns of the argument in Table.update_cells() not present in the updated table: {list(names)}.\"\n            )\n\n        if self._universe == other._universe:\n            warnings.warn(\n                \"Key sets of self and other in update_cells are the same.\"\n                + \" Using with_columns instead of update_cells.\",\n                stacklevel=_stacklevel + 4,\n            )\n            return self.with_columns(*(other[name] for name in other))\n\n        schema = {}\n        for key in other.keys():\n            schema[key] = _types_lca_with_error(\n                self.schema._dtypes()[key],\n                other.schema._dtypes()[key],\n                function_name=\"an update_cells\",\n                pointers=False,","sourceCodeStart":1713,"sourceCodeEnd":1749,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/table.py#L1713-L1749","documentation":"Raised by Table.update_cells() when the argument table contains column names that do not exist in the updated table. update_cells overwrites cell values for existing columns only; it cannot introduce new columns, so any extra column in `other` is rejected before type alignment.","triggerScenarios":"t1.update_cells(t2) where set(t2.keys()) - set(t1.keys()) is non-empty, e.g. t2 was produced by with_columns and carries an extra derived column.","commonSituations":"Feeding a table that went through enrichment/with_columns into update_cells; copying update code between pipelines whose base schemas differ; version changes where a connector added a field.","solutions":["Select only the target columns from the argument: t1.update_cells(t2.select(*t1.keys()))","Or drop the extra columns: t1.update_cells(t2.without('extra_col'))","If the extra columns should exist on both sides, add them to t1 first via with_columns, then update_cells","Guard in code: extra = set(t2.keys()) - set(t1.keys()); if extra: t2 = t2.select(*t1.keys())"],"exampleFix":"# before\nt3 = t1.update_cells(t2)  # t2 has extra column 'score'\n\n# after\nt3 = t1.update_cells(t2.select(*t1.keys()))","handlingStrategy":"validation","validationCode":"def update_cells_safe(t1, t2):\n    extra = set(t2.keys()) - set(t1.keys())\n    if extra:\n        t2 = t2.select(*t1.keys())\n    return t1.update_cells(t2)","typeGuard":null,"tryCatchPattern":"try:\n    t3 = t1.update_cells(t2)\nexcept ValueError as e:\n    if 'not present in the updated table' in str(e):\n        t3 = t1.update_cells(t2.select(*t1.keys()))","preventionTips":["Select the target column subset before update_cells","Keep update sources schema-aligned with the base table","Watch for the follow-up warning suggesting with_columns when key sets are equal"],"tags":["pathway","schema","update-cells","columns"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}