Skip to content

Fork Sync Branch 19.0 - #17

Merged
btl-bot merged 1 commit into
BTLzdravtech:19.0from
ingadhoc:19.0
Sep 17, 2026
Merged

btl-bot merged 1 commit into
BTLzdravtech:19.0from
ingadhoc:19.0

Conversation

@btl-bot

@btl-bot btl-bot commented Sep 17, 2026

Copy link
Copy Markdown

No description provided.

…, and every row of a csv

Importing an xls with a sheet mapping has been failing since the split was
introduced: the xlrd branch of split_base64_excel builds the (workbook, sheet)
tuple but never reads the rows, so `all_rows` is left unbound and the method
dies on `if not all_rows` before anything is imported.

The branch that was meant to cover it could not work either. It delegated to
`super().parse_header()`, a method no module defines -- the sheet parser has
one per format, `parse_header_csv`, `parse_header_xls` and `parse_header_xlsx`
-- and it handed `_parse_rows` a two-value tuple where it unpacks three. Past
that, it assigned the parsed statement lines to `all_rows`, which the split
below writes out as if they were the rows of the file.

So the xlrd branch now reads the rows the way the openpyxl one does, plain
values of every row and every column, and that dead branch goes away with the
two variables only it used. The header is parsed the same way for the three
formats, from the rows already read.

The csv branch read its rows differently from the other two: it dropped the
empty ones before the split. That shifted every line number below them, so a
mapping whose header row number is 2 found the header on the second *non
empty* line instead of the second line of the file, and a statement with a
blank line above the header failed with `'Date' is not in list` -- while the
same file as xlsx imported fine. It now keeps every row, like the other two
branches; empty rows are the parser's business, through skip_empty_lines.

Change note: cuando el importador de extractos corre en segundo plano, un
archivo .xls ya no falla, y un .csv cuenta el numero de fila de la cabecera
sobre las lineas que el archivo realmente tiene, igual que un Excel. Antes,
una linea en blanco arriba de la cabecera corria la cuenta y la importacion
fallaba con "'Date' is not in list".

closes #447

Signed-off-by: Camila Vives <cav@adhoc.inc>

@sireko sireko left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved

@btl-bot
btl-bot merged commit 104e22a into BTLzdravtech:19.0 Sep 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants