{"record":{"id":"7af722fec231693c","repo":"stanford-oval/storm","slug":"please-provide-the-name-of-the-content-column","errorCode":null,"errorMessage":"Please provide the name of the content column.","messagePattern":"Please provide the name of the content column\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"knowledge_storm/utils.py","lineNumber":213,"sourceCode":"            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.\")\n        if url_column is None:\n            raise ValueError(\"Please provide the name of the url column.\")\n\n        # try to initialize the Qdrant client\n        qdrant = None\n        if vector_db_mode == \"online\":\n            qdrant = QdrantVectorStoreManager._init_online_vector_db(\n                url=url,\n                api_key=qdrant_api_key,\n                collection_name=collection_name,\n                model=model,\n            )\n        elif vector_db_mode == \"offline\":\n            qdrant = QdrantVectorStoreManager._init_offline_vector_db(\n                vector_store_path=vector_store_path,\n                collection_name=collection_name,\n                model=model,\n            )","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/utils.py#L195-L231","documentation":"content_column is None; the function needs to know which CSV column holds document text to build the documents and metadata for embedding.","triggerScenarios":"Calling create_or_update_vector_store without content_column, or with it set to None via a config dict.","commonSituations":"CSV header renamed by a data vendor (e.g. 'text' vs 'body'), or the column name is parameterized and the default was removed during refactor.","solutions":["Pass the exact header name of the text column, e.g. content_column='content'","Print df.columns first to confirm the header spelling","If the column is missing from the CSV, regenerate the CSV with the expected header"],"exampleFix":"# before\ncreate_or_update_vector_store('c', 'offline', 'd.csv', None, 'url')\n# after\ncreate_or_update_vector_store('c', 'offline', 'd.csv', 'content', 'url')","handlingStrategy":"validation","validationCode":"import pandas as pd\ncols = pd.read_csv(file_path, nrows=0).columns.tolist()\nassert content_column in cols, f'{content_column} not in {cols}'","typeGuard":"def has_column(csv_path: str, col: str) -> bool:\n    import pandas as pd\n    return col in pd.read_csv(csv_path, nrows=0).columns","tryCatchPattern":"try:\n    create_or_update_vector_store('c', mode, f, content_column, url_column, ...)\nexcept ValueError as e:\n    if 'Content column' in str(e):\n        show_available_columns(f)\n        raise\n    raise","preventionTips":["Print df.columns once when onboarding a new CSV source","Document the expected schema for corpus CSVs"],"tags":["csv","column-name","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"}