{"record":{"id":"1525e458f2b63d6a","repo":"stanford-oval/storm","slug":"please-provide-a-collection-name-1525e4","errorCode":null,"errorMessage":"Please provide a collection name.","messagePattern":"Please provide a collection name\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"knowledge_storm/utils.py","lineNumber":195,"sourceCode":"        Args:\n            collection_name: Name of the Qdrant collection.\n            vector_store_path (str): Path to the directory where the vector store is stored or will be stored.\n            vector_db_mode (str): Mode of the Qdrant vector store (offline or online).\n            file_path (str): Path to the CSV file.\n            content_column (str): Name of the column containing the content.\n            title_column (str): Name of the column containing the title. Default is \"title\".\n            url_column (str): Name of the column containing the URL. Default is \"url\".\n            desc_column (str): Name of the column containing the description. Default is \"description\".\n            batch_size (int): Batch size for adding documents to the collection.\n            chunk_size: Size of each chunk if you need to build the vector store from documents.\n            chunk_overlap: Overlap between chunks if you need to build the vector store from documents.\n            embedding_model: Name of the Hugging Face embedding model.\n            device: Device to run the embeddings model on, can be \"mps\", \"cuda\", \"cpu\".\n            qdrant_api_key: API key for the Qdrant server (Only required if the Qdrant server is online).\n        \"\"\"\n        # check if the collection name is provided\n        if collection_name is None:\n            raise ValueError(\"Please provide a collection name.\")\n\n        model_kwargs = {\"device\": device}\n        encode_kwargs = {\"normalize_embeddings\": True}\n        from langchain_huggingface import HuggingFaceEmbeddings\n\n        model = HuggingFaceEmbeddings(\n            model_name=embedding_model,\n            model_kwargs=model_kwargs,\n            encode_kwargs=encode_kwargs,\n        )\n\n        if file_path is None:\n            raise ValueError(\"Please provide a file path.\")\n        # check if the file is a csv file\n        if not file_path.endswith(\".csv\"):\n            raise ValueError(f\"Not valid file format. Please provide a csv file.\")\n        if content_column is None:\n            raise ValueError(\"Please provide the name of the content column.\")","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/utils.py#L177-L213","documentation":"create_or_update_vector_store refuses to proceed when collection_name is None. The collection name identifies which Qdrant collection to create or update, so it is mandatory in all modes.","triggerScenarios":"Calling create_or_update_vector_store(collection_name=None, ...) or omitting the argument when it has no default.","commonSituations":"Building the collection name dynamically from an env var or config that is unset, or refactoring a call site and dropping the first positional argument.","solutions":["Pass an explicit collection name, e.g. collection_name='my_corpus'","Check that any variable used to build the name (config, env var, CLI arg) is populated before the call"],"exampleFix":"# before\ncreate_or_update_vector_store(None, 'offline', 'data.csv', ...)\n# after\ncreate_or_update_vector_store('my_corpus', 'offline', 'data.csv', ...)","handlingStrategy":"validation","validationCode":"collection_name = collection_name or os.environ.get('QDRANT_COLLECTION')\nif not collection_name:\n    raise SystemExit('collection_name is required (set QDRANT_COLLECTION or pass it explicitly)')","typeGuard":"def has_collection_name(name: str | None) -> bool:\n    return isinstance(name, str) and bool(name.strip())","tryCatchPattern":"try:\n    create_or_update_vector_store(collection_name, ...)\nexcept ValueError as e:\n    if 'collection name' in str(e):\n        collection_name = prompt_for_name()\n        create_or_update_vector_store(collection_name, ...)\n    else:\n        raise","preventionTips":["Make collection_name a required (non-defaulted) parameter in your wrapper functions","Fail fast on empty env vars used to build the name"],"tags":["qdrant","collection","missing-argument","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"fb951af7744dab086e34962e9bc6fe878e145f83","analyzedAt":"2026-08-28T11:56:54.780Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}