Skip to content

fix: keep a CSV column named row_number in CSVToDocument row mode - #12882

Closed
burakeyler wants to merge 1 commit into
deepset-ai:mainfrom
burakeyler:fix/csv-to-document-row-number
Closed

burakeyler wants to merge 1 commit into
deepset-ai:mainfrom
burakeyler:fix/csv-to-document-row-number

Conversation

@burakeyler

Copy link
Copy Markdown

Related Issues

Fixes #12787

Proposed Changes

_build_document_from_row merged the CSV columns into the metadata first and wrote the generated row_number afterwards, so a CSV column of that name was silently dropped:

ByteStream(data=b"text,row_number\nhello,record-42\n")
# meta before: {'row_number': 0}
# meta after:  {'row_number': 0, 'csv_row_number': 'record-42'}

The generated row number is now reserved before the merge, so the existing collision handling gives the CSV column the csv_ prefix like any other clashing column. Choosing row_number as the content column is unaffected, since the content column is skipped during the merge.

How did you test it?

Three tests added: the ordinary case, a case where csv_row_number and csv_row_number_1 are already taken (so the next suffix is used), and a control with content_column="row_number". The first two fail on main. pytest test/components/converters/test_csv_to_document.py → 20 passed.

Checklist

🤖 Generated with Claude Code

@burakeyler
burakeyler requested a review from a team as a code owner September 23, 2026 12:46
@burakeyler
burakeyler requested review from julian-risch and removed request for a team September 23, 2026 12:46
@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

@burakeyler is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

Signed-off-by: Burak Eyler <burakeyler@gmail.com>

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @burakeyler, thanks for your interest in contributing to Haystack! 🙏

⛔ First-time contributors can have at most 1 open pull request in this repository until it has been approved, so this PR was closed automatically. Your open pull request #12879 is unaffected. Once it has been approved by a maintainer, you are welcome to open more PRs. Feel free to reopen this one at that point.

See the contributing guidelines for details.

This is an automated message to help us keep the review queue healthy.

@github-actions github-actions Bot closed this Sep 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @burakeyler, thanks for your interest in contributing to Haystack! 🙏

⚠️ Issue #12787 is already being addressed by open pull request(s) #12788. Before opening a PR for an issue, please check whether a PR is already linked to it, and consider contributing to the existing PR instead. We may close duplicate PRs to keep the review queue manageable.

This is an automated message to help us keep the review queue healthy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSVToDocument row mode overwrites a CSV column named row_number

2 participants