Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix(rag): render integer CSV column labels in CSVExtractor (#43505)
Sourav Rajviec809d436ad6
diff --git a/api/core/rag/extractor/csv_extractor.py b/api/core/rag/extractor/csv_extractor.pyindex b836e789c2d..ed8b26d7939 100644--- a/api/core/rag/extractor/csv_extractor.py+++ b/api/core/rag/extractor/csv_extractor.py@@ -69,7 +69,7 @@ class CSVExtractor(BaseExtractor):# create document objectsfor i, row in df.iterrows():- content = ";".join(f"{col.strip()}: {str(row[col]).strip()}" for col in df.columns)+ content = ";".join(f"{str(col).strip()}: {str(row[col]).strip()}" for col in df.columns)source = row[self.source_column] if self.source_column else ""metadata = {"source": source, "row": i}doc = Document(page_content=content, metadata=metadata)diff --git a/api/tests/unit_tests/core/rag/extractor/test_csv_extractor.py b/api/tests/unit_tests/core/rag/extractor/test_csv_extractor.pyindex 023c28d5d14..941b6971136 100644--- a/api/tests/unit_tests/core/rag/extractor/test_csv_extractor.py+++ b/api/tests/unit_tests/core/rag/extractor/test_csv_extractor.py@@ -38,6 +38,25 @@ class TestCSVExtractor:assert docs[0].page_content == f"value: {value};body: reference"assert docs[0].metadata["source"] == value+ def test_extract_header_none_uses_integer_column_labels(self, tmp_path: Path) -> None:+ file_path = tmp_path / "headerless.csv"+ file_path.write_text("00123,NA\n00456,NULL\n", encoding="utf-8")++ docs = CSVExtractor(str(file_path), encoding="utf-8", csv_args={"header": None}).extract()++ assert len(docs) == 2+ assert docs[0].page_content == "0: 00123;1: NA"+ assert docs[1].page_content == "0: 00456;1: NULL"++ def test_extract_explicit_integer_names_in_csv_args(self, tmp_path: Path) -> None:+ file_path = tmp_path / "named.csv"+ file_path.write_text("a,b\n", encoding="utf-8")++ docs = CSVExtractor(str(file_path), encoding="utf-8", csv_args={"header": None, "names": [10, 20]}).extract()++ assert len(docs) == 1+ assert docs[0].page_content == "10: a;20: b"+def test_extract_honors_explicit_csv_args(self, tmp_path: Path) -> None:file_path = tmp_path / "data.csv"file_path.write_text("value;body\n00123;NA\n", encoding="utf-8")