{"record":{"id":"fb4acd9bcc5bf1e6","repo":"pathwaycom/pathway","slug":"vector-column-vector-name-r-does-not-belong-to","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":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/pinecone/__init__.py","lineNumber":346,"sourceCode":"    ...     table,\n    ...     index_name=\"docs-sparse\",\n    ...     primary_key=table.doc_id,\n    ...     vector=table.bm25,\n    ...     metadata_columns=[table.title],\n    ...     api_key=\"YOUR_API_KEY\",\n    ... )\n    >>> pw.run(monitoring_level=pw.MonitoringLevel.NONE)  # doctest: +SKIP\n    \"\"\"\n    _check_entitlements(\"pinecone\")\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._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_name = primary_key._name if primary_key is not None else None\n    vector_name = vector._name\n\n    if pk_name == vector_name:\n        raise ValueError(\n            f\"primary_key and vector both reference column {pk_name!r}; they must \"\n            \"be different columns.\"\n        )\n\n    if metadata_columns is None:\n        metadata_names = [\n            col_name\n            for col_name in table.column_names()","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/pinecone/__init__.py#L328-L364","documentation":"Raised by pw.io.pinecone.write() when the column passed as vector= belongs to a different table than the table being written. Pathway column references carry their owning table, and the connector refuses to build a dataflow that mixes columns from unrelated tables. The message tells you the exact reference to re-pass, e.g. vector=table.embedding.","triggerScenarios":"Calling pw.io.pinecone.write(table, ..., vector=other_table.embedding) where other_table is not the same object as table; or passing a column from a table produced by a transform (e.g. table.select(...), table.with_columns(...)) while still passing the pre-transform table as the first argument.","commonSituations":"Common after refactoring a pipeline: a select()/with_columns() step is inserted between table creation and the write, and the old variable still names the original table. Also happens when writing multiple derived tables and copy-pasting the write() call.","solutions":["Pass the column reference from the same table object you pass as the first argument: pw.io.pinecone.write(table, ..., vector=table.embedding).","If you transformed the table (select/with_columns/rename), pass the transformed table as the first argument and use its column reference.","Verify identity before the call: assert vector._table is table (useful in tests)."],"exampleFix":"# before\npw.io.pinecone.write(original, index_name=\"docs\", vector=embeddings.embedding, api_key=k)\n# after\npw.io.pinecone.write(embeddings, index_name=\"docs\", vector=embeddings.embedding, api_key=k)","handlingStrategy":"validation","validationCode":"def assert_same_table(table, *cols):\n    for c in cols:\n        if c._table is not table:\n            raise ValueError(f\"column {c._name!r} is not from the given table\")\n\nassert_same_table(table, vector)  # before pw.io.pinecone.write(...)","typeGuard":null,"tryCatchPattern":"try:\n    pw.io.pinecone.write(table, index_name=\"docs\", vector=table.emb, api_key=k)\nexcept ValueError as e:\n    if \"does not belong to the provided table\" in str(e):\n        raise ValueError(f\"wrong table reference: {e}\") from e\n    raise","preventionTips":["Keep one variable per table and always reference columns through it at the write call.","After adding select/with_columns steps, update the table passed to write() and all column references together.","Add a tiny unit test that asserts vector._table is table before wiring the connector."],"tags":["pinecone","pathway","column-reference","api-misuse"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}