{"record":{"id":"f4388883520e6d1b","repo":"pathwaycom/pathway","slug":"metadata-column-col-name-r-does-not-belong-to-t-f43888","errorCode":null,"errorMessage":"metadata column {col._name!r} does not belong to the provided table. Pass column references from the same table, e.g. table.{col._name}.","messagePattern":"metadata column (.+?) does not belong to the provided table\\. Pass column references from the same table, e\\.g\\. table\\.(.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/pinecone/__init__.py","lineNumber":371,"sourceCode":"    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()\n            if col_name not in (pk_name, vector_name)\n        ]\n    else:\n        metadata_names = []\n        for col in metadata_columns:\n            if col._table is not table:\n                raise ValueError(\n                    f\"metadata column {col._name!r} does not belong to the \"\n                    f\"provided table. Pass column references from the same table, \"\n                    f\"e.g. table.{col._name}.\"\n                )\n            if col._name in (pk_name, vector_name):\n                role = \"primary_key\" if col._name == pk_name else \"vector\"\n                raise ValueError(\n                    f\"column {col._name!r} is used as the {role} and cannot also \"\n                    \"be a metadata column. Remove it from metadata_columns.\"\n                )\n            metadata_names.append(col._name)\n\n    if batch_size <= 0:\n        raise ValueError(f\"batch_size must be a positive integer, got {batch_size}.\")\n\n    if pk_name is not None:\n        _check_primary_key_dtype(pk_name, table._get_column(pk_name).dtype)\n    _check_vector_dtype(vector_name, table._get_column(vector_name).dtype)","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/pinecone/__init__.py#L353-L389","documentation":"Raised by pw.io.pinecone.write() when a column in the explicit metadata_columns list belongs to a table other than the one being written. Each metadata column must be a reference (e.g. table.title) from the same table object passed as the first argument.","triggerScenarios":"Passing metadata_columns=[other.col] where other is not table; mixing columns from a base table and a derived table (after select/join/with_columns) in one metadata_columns list.","commonSituations":"Hybrid search setups where two write() calls (dense and sparse index) are copy-pasted and metadata column references are not updated to the current table variable.","solutions":["Re-pass every metadata column from the same table: metadata_columns=[table.title].","If you need columns from several sources, join/select them into one table first, then write that table."],"exampleFix":"# before\npw.io.pinecone.write(base, index_name=\"docs\", vector=base.emb, metadata_columns=[joined.title], api_key=k)\n# after\njoined2 = base.select(base.emb, title=joined.title)\npw.io.pinecone.write(joined2, index_name=\"docs\", vector=joined2.emb, metadata_columns=[joined2.title], api_key=k)","handlingStrategy":"validation","validationCode":"valid = set(table.column_names())\nfor col in metadata_columns or []:\n    assert col._table is table, f\"{col._name!r} not from table\"\n    assert col._name in valid","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build metadata_columns as a list comprehension over the exact table object you pass to write().","In hybrid-search setups, define metadata_columns once per write() call and re-derive them from the current table."],"tags":["pinecone","pathway","column-reference","metadata"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}