Repository navigation
docs: document that XLSXToDocument row numbering assumes the pandas positional index - #13566
Conversation
|
@Smilewithoutfalling is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
2075ff9 to
aa5e359
Compare
anakin87
left a comment
There was a problem hiding this comment.
Hello and thank you!
I think that supporting every possible combination of read_excel_kwargs is out of scope, so I'd suggest simply improving the docstring to communicate the limitations, similarly to
haystack/haystack/components/preprocessors/csv_document_splitter.py
Lines 44 to 51 in 0de7bcd
…ositional index `XLSXToDocument` numbers the rows of the output table from 1 so that they match the Excel row numbers, which only holds when pandas assigns the positional index. Supporting every combination of `read_excel_kwargs` in the converter is out of scope, so the limitation is documented in the `read_excel_kwargs` docstring instead, following the `CSVDocumentSplitter` wording. The paragraph names the two effects that matter: options such as `skiprows` or `index_col` make the numbering inaccurate, and a source whose `index_col` holds non-numeric values is skipped. No behavior change.
aa5e359 to
6534647
Compare
|
Thanks for the review — reverted the One thing worth knowing while writing that paragraph: with If you'd rather fix that one case than document it, I can open a follow-up that guards only |
Related Issues
Proposed Changes
XLSXToDocumentnumbers the rows of the output table from 1 so that they match the Excel row numbers:That only holds when pandas assigns the positional index. Supporting every combination of
read_excel_kwargsin the converter is out of scope, so this documents the limitation in theread_excel_kwargsdocstring instead, following theCSVDocumentSplitterwording.The added paragraph states that:
skiprowsorindex_col, make the numbering inaccurate;index_colholds non-numeric values is skipped;Behavior is unchanged — the diff is docstring only.
How did you test it?
No behavior change, so no new test. I checked that the documented behavior is what
mainactually does:index_colon a string columncan only concatenate str (not "int") to strindex_colon a numeric column with a header rowindex_colon a numeric column without a header row101, 102→102, 103skiprows=2ruff checkandruff format --checkreport the same results as on unmodifiedmainfor this file.Notes for the reviewer
0de7bcdc.index_colfailure above is a separate pre-existing defect. Happy to send a follow-up that guards only that case if you'd rather fix it than document it.Checklist