{"record":{"id":"3657b66266c18241","repo":"apache/beam","slug":"collection-name-must-be-provided-qdrant","errorCode":null,"errorMessage":"Collection name must be provided","messagePattern":"Collection name must be provided","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/ml/rag/ingestion/qdrant.py","lineNumber":199,"sourceCode":"    timeout: Optional timeout for write operations in seconds. Default is None.\n    batch_size: Number of points to write in each batch. Default is 1000.\n    kwargs: Additional keyword arguments to pass to the client's upsert method.\n    dense_embedding_key: name for the dense vector in the qdrant collection.\n    sparse_embedding_key: name for the sparse vector in the qdrant collection.\n  \"\"\"\n\n  connection_params: QdrantConnectionParameters\n  collection_name: str\n  timeout: Optional[int] = None\n  batch_size: int = DEFAULT_WRITE_BATCH_SIZE\n  max_batch_byte_size: int = DEFAULT_MAX_BATCH_BYTE_SIZE\n  kwargs: dict[str, Any] = field(default_factory=dict)\n  dense_embedding_key: str = \"dense\"\n  sparse_embedding_key: str = \"sparse\"\n\n  def __post_init__(self):\n    if not self.collection_name:\n      raise ValueError(\"Collection name must be provided\")\n    if self.batch_size <= 0:\n      raise ValueError(\"Batch size must be a positive integer\")\n\n  def create_write_transform(self) -> beam.PTransform[EmbeddableItem, Any]:\n    return _QdrantWriteTransform(self)\n\n  def create_converter(\n      self,\n  ) -> Callable[[EmbeddableItem], \"models.PointStruct\"]:\n    def convert(item: EmbeddableItem) -> \"models.PointStruct\":\n      if item.dense_embedding is None and item.sparse_embedding is None:\n        raise ValueError(\n            \"EmbeddableItem must have at least one embedding (dense or sparse)\")\n      vector = {}\n      if item.dense_embedding is not None:\n        vector[self.dense_embedding_key] = item.dense_embedding\n      if item.sparse_embedding is not None:\n        sparse_indices, sparse_values = item.sparse_embedding","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/ml/rag/ingestion/qdrant.py#L181-L217","documentation":"The Qdrant write sink dataclass requires collection_name in __post_init__; without it Qdrant would not know which collection to upsert points into. The library fails fast at config construction instead of mid-pipeline.","triggerScenarios":"Constructing the Qdrant sink config (e.g. QdrantWriteParameters / CustomOptionsJunction) with collection_name=None or empty string '', then calling create_write_transform() or adding the sink to a Beam pipeline.","commonSituations":"Forgetting to pass collection_name through pipeline options; typos like collection='items'; building configs from env vars where the collection variable is unset; running against a recreated cluster where the intended collection name was lost from config.","solutions":["Pass a non-empty collection_name when constructing the sink config","Check that the value isn't an empty string (which also fails this check)","Create the collection in Qdrant first and use its exact name","If read from options, add a default or assert it's set before building the pipeline"],"exampleFix":"// before\nparams = QdrantWriteParameters(host=..., port=6333)\n// after\nparams = QdrantWriteParameters(host=..., port=6333, collection_name=\"rag_chunks\")","handlingStrategy":"validation","validationCode":"if not collection_name:\n    raise ValueError(\"Set --qdrant_collection before building the pipeline\")","typeGuard":"def has_collection(params) -> bool:\n    return isinstance(params.collection_name, str) and params.collection_name != \"\"","tryCatchPattern":null,"preventionTips":["Give collection_name a required pipeline option with no default","Verify the collection exists in Qdrant with the exact same name","Avoid empty-string defaults when plumbing options into the sink config"],"tags":["python","qdrant","configuration","vector-database"],"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-20T03:17:13.778Z"}