{"record":{"id":"d3b2ca166eaf4650","repo":"cocoindex-io/cocoindex","slug":"qdrant-kind-name-must-not-be-empty","errorCode":null,"errorMessage":"Qdrant {kind} name must not be empty","messagePattern":"Qdrant (.+?) name must not be empty","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/cocoindex/connectors/qdrant/_target.py","lineNumber":725,"sourceCode":"        size=dim,\n        distance=_distance_from_spec(vector_def.distance),\n        multivector_config=multivector_config,\n    )\n\n\ndef _sparse_vector_params_from_def(\n    sparse_vector_def: _ResolvedQdrantSparseVectorDef,\n) -> qdrant_models.SparseVectorParams:\n    \"\"\"Convert a resolved sparse vector definition to Qdrant SparseVectorParams.\"\"\"\n    return qdrant_models.SparseVectorParams(\n        modifier=_sparse_modifier_from_spec(sparse_vector_def.modifier)\n    )\n\n\ndef _validate_vector_names(names: Collection[str], kind: str) -> None:\n    for name in names:\n        if not name:\n            raise ValueError(f\"Qdrant {kind} name must not be empty\")\n\n\n_POINT_ID_RULE = (\n    \"Qdrant point IDs must be an unsigned 64-bit integer or a UUID \"\n    \"(str or uuid.UUID); see \"\n    \"https://qdrant.tech/documentation/manage-data/points/#point-ids. For a \"\n    \"stable ID derived from an arbitrary string key, use uuid.uuid5, e.g. \"\n    'str(uuid.uuid5(uuid.NAMESPACE_URL, f\"doc/{key}\")).'\n)\n\n\ndef _validate_point_id(raw: object) -> _PointId:\n    \"\"\"Validate a point ID against Qdrant's server-side rules, eagerly.\n\n    Qdrant only accepts unsigned 64-bit integers and UUIDs (any textual\n    form: hyphenated, 32-char hex, or URN); everything else is rejected at\n    upsert time with an opaque transport error, so fail at declare time\n    with an actionable one instead.","sourceCodeStart":707,"sourceCodeEnd":743,"githubUrl":"https://github.com/cocoindex-io/cocoindex/blob/e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b/python/cocoindex/connectors/qdrant/_target.py#L707-L743","documentation":"Qdrant vector names must be non-empty strings. _validate_vector_names iterates every name in the vectors dict and raises this ValueError if any name is an empty string (or otherwise falsy). It is called from CollectionSchema.create for both dense and sparse named vectors (the `kind` parameter labels the message).","triggerScenarios":"Passing a dict to CollectionSchema.create with an empty-string key, e.g. vectors={\"\": QdrantVectorDef(...)} — usually from programmatic name construction or config parsing that produced an empty name.","commonSituations":"Building vector names by concatenating prefixes and getting \"\"; config files where the vector name field is blank; dict comprehension over metadata where the key is missing/empty.","solutions":["Give every vector in the dict a non-empty name, e.g. vectors={\"embedding\": ...}.","Filter or assert on names before calling create: assert all(names) for names in vectors.","Fix the upstream config/code that produced the empty key."],"exampleFix":"// before\nawait CollectionSchema.create(vectors={\"\": QdrantVectorDef(schema=vec, distance=\"cosine\")})\n// after\nawait CollectionSchema.create(vectors={\"embedding\": QdrantVectorDef(schema=vec, distance=\"cosine\")})","handlingStrategy":"validation","validationCode":"assert vectors and all(name for name in vectors), f\"empty vector name in {list(vectors)}\"","typeGuard":"isinstance(vectors, dict) and all(isinstance(k, str) and k for k in vectors)","tryCatchPattern":"try:\n    schema = await CollectionSchema.create(vectors=vectors)\nexcept ValueError as e:\n    raise ConfigError(f\"vector names invalid: {e}\") from None","preventionTips":["Check vector name construction (prefix + key) for empty results.","Reject blank name fields when parsing config.","Log the full vectors dict on schema build failure."],"tags":["qdrant","validation","naming"],"backgroundTag":"empty-required-field","analyzedSha":"e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b","analyzedAt":"2026-09-08T15:59:19.997Z","contentChangedAt":"2026-09-08T15:59:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}