{"record":{"id":"6bdff8ec57cb0c2c","repo":"pathwaycom/pathway","slug":"vector-column-vector-name-r-does-not-belong-to-6bdff8","errorCode":null,"errorMessage":"vector column {vector._name!r} does not belong to the provided table. Pass a column reference from the same table, e.g. vector=table.{vector._name}.","messagePattern":"vector column (.+?) does not belong to the provided table\\. Pass a column reference from the same table, e\\.g\\. vector=table\\.(.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/weaviate/__init__.py","lineNumber":122,"sourceCode":"\n    >>> pw.io.weaviate.write(  # doctest: +SKIP\n    ...     table,\n    ...     collection_name=\"Docs\",\n    ...     primary_key=table.doc_id,\n    ...     vector=table.embedding,\n    ... )\n    >>> pw.run(monitoring_level=pw.MonitoringLevel.NONE)  # doctest: +SKIP\n    \"\"\"\n    _check_entitlements(\"weaviate\")\n\n    if primary_key is not None and primary_key._table is not table:\n        raise ValueError(\n            f\"primary_key column {primary_key._name!r} does not belong to the \"\n            f\"provided table. Pass a column reference from the same table, \"\n            f\"e.g. primary_key=table.{primary_key._name}.\"\n        )\n    if vector is not None and vector._table is not table:\n        raise ValueError(\n            f\"vector column {vector._name!r} does not belong to the provided \"\n            f\"table. Pass a column reference from the same table, \"\n            f\"e.g. vector=table.{vector._name}.\"\n        )\n\n    pk = primary_key._name if primary_key is not None else None\n    vector_field = vector._name if vector is not None else None\n\n    # Weaviate reserves \"id\" and \"vector\" as object-level keys and rejects them as\n    # property names. The primary key (encoded in the UUID) and the vector column\n    # are never sent as properties, so they may freely use these names; any other\n    # column that does collides and is reported up front.\n    reserved_property_columns = [\n        column_name\n        for column_name in table.schema.column_names()\n        if column_name in (\"id\", \"vector\")\n        and column_name != pk\n        and column_name != vector_field","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/weaviate/__init__.py#L104-L140","documentation":"The Weaviate output connector requires the `vector` column reference to belong to the same pw.Table instance passed as `table`, since the vectors written must line up row-for-row with the table being indexed. write() compares vector._table to table and raises this ValueError pointing at the correct expression when the reference comes from another table object.","triggerScenarios":"Calling pw.io.weaviate.write(table_a, ..., vector=table_b.embedding) where table_b is a different table instance — typically the pre-transform table or a side table produced by an embedding step.","commonSituations":"Computing embeddings on one table (t_embedded = t + t.select(embedding=pw.apply(embed))) and then passing the original t as `table` with vector=t_embedded.embedding; keeping stale references after refactor; joining metadata onto an embedded table and mixing up which object to pass.","solutions":["Write from the table that actually holds the embedding column and reference it directly: pw.io.weaviate.write(t_embedded, vector=t_embedded.embedding).","Add the embedding column to the table you intend to pass: t = t + embedded.select(embedding=pw.this.embedding) before write()."],"exampleFix":"# before\nt_emb = t + t.select(embedding=pw.apply(embed_fn, pw.this.text))\npw.io.weaviate.write(t, collection_name=\"Docs\", vector=t_emb.embedding)\n\n# after\npw.io.weaviate.write(t_emb, collection_name=\"Docs\", vector=t_emb.embedding)","handlingStrategy":"validation","validationCode":"def check_column_belongs(table, col, arg=\"vector\"):\n    if col is not None and col._table is not table:\n        raise ValueError(f\"{arg} column {col.name!r} is not from the given table\")\n    return True","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute embeddings with table + table.select(...) style expressions so the resulting object owns the embedding column, then write that object.","Lint for the anti-pattern of passing table_a/table_b.mix mixes: both table and column arguments should come from one variable."],"tags":["pathway","weaviate","vector-store","column-reference","embeddings"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}