{"record":{"id":"31730285adf6819c","repo":"apache/beam","slug":"write-config-must-be-provided-with-table-specified","errorCode":null,"errorMessage":"write_config must be provided with 'table' specified","messagePattern":"write_config must be provided with 'table' specified","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/ml/rag/ingestion/bigquery.py","lineNumber":130,"sourceCode":"      >>> config = BigQueryVectorWriterConfig(\n      ...   write_config={'table': 'project.dataset.embeddings'},\n      ...   schema_config=schema_config\n      ... )\n\n    Args:\n        write_config: BigQuery write configuration dict. Must include 'table'.\n            Other options like create_disposition, write_disposition can be\n            specified.\n        schema_config: Optional configuration for custom schema and row\n            conversion.\n            If not provided, uses default schema with id, embedding, content and\n            metadata columns.\n    \n    Raises:\n        ValueError: If write_config doesn't include table specification.\n    \"\"\"\n    if 'table' not in write_config:\n      raise ValueError(\"write_config must be provided with 'table' specified\")\n\n    self.write_config = write_config\n    self.schema_config = schema_config\n\n  def create_write_transform(self) -> beam.PTransform:\n    \"\"\"Creates transform to write to BigQuery.\"\"\"\n    return _WriteToBigQueryVectorDatabase(self)\n\n\ndef _default_embeddable_to_dict_fn(item: EmbeddableItem):\n  if item.embedding is None or item.embedding.dense_embedding is None:\n    raise ValueError(\"EmbeddableItem must contain dense embedding\")\n  return {\n      'id': item.id,\n      'embedding': item.embedding.dense_embedding,\n      'content': item.content_string,\n      'metadata': [{\n          \"key\": k, \"value\": str(v)","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/ml/rag/ingestion/bigquery.py#L112-L148","documentation":"BigQueryVectorWriterConfig validates at construction time that its write_config dict includes a 'table' key identifying the destination BigQuery table. Without it the writer cannot build the BigQuery write sink, so a ValueError is raised.","triggerScenarios":"Constructing BigQueryVectorWriterConfig(schema_config=..., write_config={...}) where write_config lacks 'table' — e.g., only passing create_disposition or other options.","commonSituations":"Copy-pasted write_config dicts missing the table; building write_config dynamically where the table key is injected later; confusing write_config with SchemaConfig parameters.","solutions":["Add 'table': 'project:dataset.table' (or dataset.table) to the write_config dict","Also add 'project' when not using the fully-qualified table form","Validate the write_config keys before constructing the config"],"exampleFix":"// before\nwrite_config = {'project': 'my-project', 'create_disposition': 'CREATE_IF_NEEDED'}\n// after\nwrite_config = {'project': 'my-project', 'table': 'my-project:my_dataset.embeddings'}","handlingStrategy":"validation","validationCode":"assert 'table' in write_config and write_config['table'], \"write_config['table'] required\"","typeGuard":"def has_table(write_config: dict) -> bool:\n    return bool(write_config.get('table'))","tryCatchPattern":"try:\n    cfg = BigQueryVectorWriterConfig(schema_config=sc, write_config=wc)\nexcept ValueError as e:\n    if 'table' in str(e): wc['table'] = f'{project}:{dataset}.{table}'; cfg = BigQueryVectorWriterConfig(sc, wc)\n    else: raise","preventionTips":["Always include the table key in write_config","Use fully-qualified 'project:dataset.table' strings","Validate write_config dicts in a shared builder"],"tags":["python","apache-beam","bigquery","rag","config"],"backgroundTag":"missing-required-config-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}