{"record":{"id":"6d27bb1b356833bd","repo":"stanford-oval/storm","slug":"not-valid-file-format-please-provide-a-csv-file","errorCode":null,"errorMessage":"Not valid file format. Please provide a csv file.","messagePattern":"Not valid file format\\. Please provide a csv file\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"knowledge_storm/utils.py","lineNumber":211,"sourceCode":"        # 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.\")\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,","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/utils.py#L193-L229","documentation":"The ingested file must be a CSV; any path not ending in '.csv' is rejected before parsing. This is a cheap extension check ahead of pd.read_csv.","triggerScenarios":"Passing a .tsv, .xlsx, .json, .txt, .parquet, or any path without the .csv suffix.","commonSituations":"Team exports from Excel (.xlsx) or TSV logs and points the pipeline at them directly; case-sensitive issue is rare (only suffix is checked) but wrong-format files with a renamed .csv extension pass this check and fail later.","solutions":["Convert the data to CSV (e.g. pandas df.to_csv(...)) and pass the .csv path","If you have TSV/XLSX, export or re-save as CSV first","Ensure the file genuinely contains comma-separated data with a header row"],"exampleFix":"# before\ncreate_or_update_vector_store('c', 'offline', 'docs.xlsx', 'content', 'url')\n# after\nimport pandas as pd\npd.read_excel('docs.xlsx').to_csv('docs.csv', index=False)\ncreate_or_update_vector_store('c', 'offline', 'docs.csv', 'content', 'url')","handlingStrategy":"validation","validationCode":"from pathlib import Path\nif not file_path.lower().endswith('.csv'):\n    raise SystemExit(f'Expected a .csv file, got {file_path}')","typeGuard":"def is_csv(path: str) -> bool:\n    return path.lower().endswith('.csv')","tryCatchPattern":"try:\n    create_or_update_vector_store('c', mode, file_path, ...)\nexcept ValueError as e:\n    if 'Not valid file format' in str(e):\n        file_path = convert_to_csv(file_path)  # your converter\n        create_or_update_vector_store('c', mode, file_path, ...)\n    else:\n        raise","preventionTips":["Standardize ingestion on CSV export in your data pipeline","Convert xlsx/tsv at the boundary with pandas to_csv"],"tags":["csv","file-format","validation"],"backgroundTag":"unsupported-file-format","analyzedSha":"fb951af7744dab086e34962e9bc6fe878e145f83","analyzedAt":"2026-08-28T11:56:54.780Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}