stanford-oval/storm · error · ValueError

Not valid file format. Please provide a csv file.

Error message

Not valid file format. Please provide a csv file.

What it means

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.

Source

Thrown at knowledge_storm/utils.py:211

        # check if the collection name is provided
        if collection_name is None:
            raise ValueError("Please provide a collection name.")

        model_kwargs = {"device": device}
        encode_kwargs = {"normalize_embeddings": True}
        from langchain_huggingface import HuggingFaceEmbeddings

        model = HuggingFaceEmbeddings(
            model_name=embedding_model,
            model_kwargs=model_kwargs,
            encode_kwargs=encode_kwargs,
        )

        if file_path is None:
            raise ValueError("Please provide a file path.")
        # check if the file is a csv file
        if not file_path.endswith(".csv"):
            raise ValueError(f"Not valid file format. Please provide a csv file.")
        if content_column is None:
            raise ValueError("Please provide the name of the content column.")
        if url_column is None:
            raise ValueError("Please provide the name of the url column.")

        # try to initialize the Qdrant client
        qdrant = None
        if vector_db_mode == "online":
            qdrant = QdrantVectorStoreManager._init_online_vector_db(
                url=url,
                api_key=qdrant_api_key,
                collection_name=collection_name,
                model=model,
            )
        elif vector_db_mode == "offline":
            qdrant = QdrantVectorStoreManager._init_offline_vector_db(
                vector_store_path=vector_store_path,
                collection_name=collection_name,

View on GitHub (pinned to fb951af774)

Solutions

  1. Convert the data to CSV (e.g. pandas df.to_csv(...)) and pass the .csv path
  2. If you have TSV/XLSX, export or re-save as CSV first
  3. Ensure the file genuinely contains comma-separated data with a header row

Example fix

# before
create_or_update_vector_store('c', 'offline', 'docs.xlsx', 'content', 'url')
# after
import pandas as pd
pd.read_excel('docs.xlsx').to_csv('docs.csv', index=False)
create_or_update_vector_store('c', 'offline', 'docs.csv', 'content', 'url')
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
if not file_path.lower().endswith('.csv'):
    raise SystemExit(f'Expected a .csv file, got {file_path}')

Type guard

def is_csv(path: str) -> bool:
    return path.lower().endswith('.csv')

Try / catch

try:
    create_or_update_vector_store('c', mode, file_path, ...)
except ValueError as e:
    if 'Not valid file format' in str(e):
        file_path = convert_to_csv(file_path)  # your converter
        create_or_update_vector_store('c', mode, file_path, ...)
    else:
        raise

Prevention

When it happens

Trigger: Passing a .tsv, .xlsx, .json, .txt, .parquet, or any path without the .csv suffix.

Common situations: 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.

Related errors


AI-assisted analysis of stanford-oval/storm@fb951af774 (2026-08-28). Data as JSON: /api/errors/6d27bb1b356833bd. Report an issue: GitHub.