pathwaycom/pathway · error · ValueError
vector column {vector._name!r} does not belong to the provid
Error message
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}. What it means
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.
Source
Thrown at python/pathway/io/pinecone/__init__.py:346
... table,
... index_name="docs-sparse",
... primary_key=table.doc_id,
... vector=table.bm25,
... metadata_columns=[table.title],
... api_key="YOUR_API_KEY",
... )
>>> pw.run(monitoring_level=pw.MonitoringLevel.NONE) # doctest: +SKIP
"""
_check_entitlements("pinecone")
if primary_key is not None and primary_key._table is not table:
raise ValueError(
f"primary_key column {primary_key._name!r} does not belong to the "
f"provided table. Pass a column reference from the same table, "
f"e.g. primary_key=table.{primary_key._name}."
)
if vector._table is not table:
raise ValueError(
f"vector column {vector._name!r} does not belong to the provided "
f"table. Pass a column reference from the same table, "
f"e.g. vector=table.{vector._name}."
)
pk_name = primary_key._name if primary_key is not None else None
vector_name = vector._name
if pk_name == vector_name:
raise ValueError(
f"primary_key and vector both reference column {pk_name!r}; they must "
"be different columns."
)
if metadata_columns is None:
metadata_names = [
col_name
for col_name in table.column_names()View on GitHub (pinned to fa2f74a464)
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).
Example fix
# before pw.io.pinecone.write(original, index_name="docs", vector=embeddings.embedding, api_key=k) # after pw.io.pinecone.write(embeddings, index_name="docs", vector=embeddings.embedding, api_key=k)
Defensive patterns
Strategy: validation
Validate before calling
def assert_same_table(table, *cols):
for c in cols:
if c._table is not table:
raise ValueError(f"column {c._name!r} is not from the given table")
assert_same_table(table, vector) # before pw.io.pinecone.write(...) Try / catch
try:
pw.io.pinecone.write(table, index_name="docs", vector=table.emb, api_key=k)
except ValueError as e:
if "does not belong to the provided table" in str(e):
raise ValueError(f"wrong table reference: {e}") from e
raise Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- primary_key column {primary_key._name!r} does not belong to
- Table.__getitem__ argument has to be a ColumnReference to th
- metadata column {col._name!r} does not belong to the provide
- statistical.diff(): Invalid column reference for the paramet
- parameters `schema` and `id_from` are mutually exclusive
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/fb4acd9bcc5bf1e6.
Report an issue: GitHub.