You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
8000
Dismiss alert
{{ message }}
Repository navigation
[Bug]: QA text chunker reads a comma CSV as TAB when a quoted field spans lines and any TAB is present #22807
A comma-separated Q&A text file is read as TAB separated when two conditions hold together:
any character in the payload is a TAB (for example inside a quoted answer), and
a quoted field spans physical lines, which RFC 4180 allows and the extractor itself supports.
The whole file is then parsed with the TAB reader, every physical line becomes a single field, and the ingestion produces no Q&A pairs. The failure is silent: the document is ingested with zero chunks and no error is reported.
Steps to reproduce
Ingest this faq.txt (commas, one quoted answer over two lines, one TAB inside a later answer):
"Q1","first line
second line"
"Q2","plain"
"Q3","has<TAB>tab"
Expected: three Q&A chunks, with Q1's answer containing the embedded newline.
Actual: no Q&A pair is extracted.
Root cause
detectDelimiter in internal/ingestion/component/chunker/qa.go splits the payload into physical lines and parses each line with its own csv.Reader. On this payload the fragments do not look like two-value comma records, so the heuristic settles on TAB.
The reference it mirrors (csv_pair_delimiter from the removed rag/app/qa.py) reads the payload with one csv.reader over all lines, and the Go extractor extractQATextCSV also reads the full text with one csv.Reader so quoted fields spanning lines form one record. Only the delimiter detection still reads line by line, so it can disagree with the parser it is choosing for.
Differential check against the reference over 3000 generated well-formed comma CSVs with embedded newlines and TAB characters: 171 files are classified as TAB; after reading the payload with one reader, 0 differ from the reference.
Version
main (the per-line detectDelimiter comes from #22749, merge commit 0534824)
Activity