← Blog
How it works TableRune

A row an import skips has to be in its report

“A customer says rows are missing after an import. The file opens fine in their spreadsheet app, the import said it succeeded, and nothing anywhere tells me which rows did not make it or why, so I cannot tell whether their file is wrong or our importer is.”

Here is a sheet with five awkward rows in it. A title banner on row 1, a blank row on row 2, column labels on row 3, then one ordinary record, a row that stops after two cells, a row whose date cell is empty, a real supplier whose name begins "Tổng công ty" and who has no code yet, a row whose code cell holds an #N/A formula, and finally a genuine totals row. We built it with openpyxl 3.1.2 and read it back with two independent readers, openpyxl and SheetJS 0.20.3:

--- openpyxl 3.1.2, data_only=False: max_row=9, rows yielded=9
  r1: ('Partner list 2026', None, None, None)
  r2: (None, None, None, None)
  r3: ('Code', 'Partner', 'Date', 'Amount')
  r4: ('P001', 'Acme Ltd', '2026-01-15', 100)
  r5: ('P002', 'Beta Co', None, None)
  r6: ('P003', 'Gamma GmbH', None, 300)
  r7: (None, 'Tổng công ty Example', '2026-01-20', 400)
  r8: ('=NA()', 'Delta', '2026-01-21', 500)
  r9: (None, 'Tổng cộng', None, 1300)

SheetJS, asked for arrays (sheet_to_json(ws, { header: 1 })), returns the same nine rows with the same values, except row 8, which the next sections come to.

Nine rows in, nine rows out. Not one of the awkward ones was dropped. That is the whole starting point of this post, and it has a consequence: if rows with content in them are missing after an import, the reader did not lose them. Your code did.

One qualification, because the most common SheetJS call does skip something. Ask it for objects keyed by the header (sheet_to_json(ws), no options) and it returns seven rows: the first row becomes the keys, and the fully blank row 2 is left out, because its blankrows option defaults to off unless you ask for arrays. That is a skip below your code, but it is the structural kind, and it takes nothing with it: there was nothing in the row. Every row with a value in it came back.

The short row is not short

Look at r5. We wrote two cells into it. The file stores two cells into it: opening xl/worksheets/sheet1.xml shows <row r="5"> holding A5 and B5 and nothing else. openpyxl returned a four-tuple, padding the end with None. SheetJS returned a two-element array, and pads it to four only if you pass defval. Neither is reporting that the row is short: one fills the rectangle, the other stops at the last cell that exists.

That padding is not a convenience. It is the format being honest. A sheet is a grid, every cell carries its own address, and a cell with no content is simply absent from the XML rather than present and empty. So "this row is shorter than the others" is not a fact the file records and not a fact the reader can report. The reader knows the sheet's extent, it knows which addresses exist, and it gives you the cells that exist, padded into a rectangle or not depending on the reader.

Which means a "short row" check in an importer is the application inventing a category, then deciding what to do about a row that falls into it. Reasonable. But the row it drops is one the file never marked as odd, so nothing downstream will ever notice the drop on its own.

The same goes for r6, the row with the empty date. C6 is absent from the file. It is absent in exactly the way C5 is absent and D5 is absent, and in exactly the way every cell of r2 is absent. Emptiness is absence, uniformly, and the importer is the only thing deciding that absence in one column is fatal while absence in another is fine.

Two kinds of skip, and only one of them can be reported honestly

Some skips are about structure. A row with no cells at all. A cell whose address is past the end of what a spreadsheet can hold. These are decidable from the file, they are decidable the same way every time, and you can count them and say what you counted.

Other skips are about meaning. "This is a totals row." "This row has no code." These are guesses about content, and a guess about content can be wrong about a real record.

Our sheet has both of the rows that matter here. r9 is a genuine totals row: the file stores B9 and D9, so the code cell and the date cell are absent. r7 is a real supplier who has not been given a code yet: the file stores B7, C7 and D7, so the code cell is absent there too. Neither row carries any marker saying which it is. There is no attribute for it, because SpreadsheetML has no notion of a totals row in a plain sheet. The only thing separating them is the text somebody typed in column B.

So an importer that wants to drop the totals row has to read that text and judge it. And the judgement is made in a language where "Tổng cộng" means total and "Tổng công ty" means corporation, which share their first word.

The same cell, five answers, decided by flags about something else

Now r8, where the code cell holds a formula that errors. openpyxl wrote it as <c r="A8"><f>NA()</f><v /></c>: a formula element, and a cached value element with nothing in it, because openpyxl does not evaluate formulas and so has no result to cache. A spreadsheet app that does evaluate it caches the error, which the format records as an error-typed cell. We made a copy of the workbook with that one cell edited by hand to the form the format defines for it, <c r="A8" t="e"><f>NA()</f><v>#N/A</v></c>, and read both files:

how the code cell of row 8 is read nothing cached #N/A cached
openpyxl, data_only=False '=NA()' '=NA()'
openpyxl, data_only=True None '#N/A'
SheetJS, sheet_to_json null null
SheetJS, sheet_to_csv empty field #N/A

An importer checking "does this row have a code" can get a seven-character formula, a four-character error string, or a value indistinguishable from a blank cell. Two of those are non-empty, so a row with no real code passes the check. Which one it gets depends on the library, on whether you asked for formulas or their results, on whether you asked for values or for text, and on which program last saved the file. None of those choices is about codes, and nobody making them was thinking about the missing-code check two modules away.

We did not run Excel, so the hand-edited cell is the form the format specifies for a cached error, not a claim about the bytes any particular version of Excel writes.

Two projects hitting this now

Both of these are other people's open-source issues. We read them; we did not run either codebase.

ANSER-Logistics/ANSER-logistics-body#10, "Excel import drops or misreads rows without telling the user", opened 3 November 2026 and still open, reports both halves of the above in one importer, frontend/src/server/import/doc-excel.ts. A customer or supplier named "Tổng công ty …" with no code "is treated as the totals row and skipped (boQua)" rather than raising a missing-code error, so the user never learns the row went missing. And a formula cell with an error in a text column "is read as the string [object Object] instead of blank", which is a non-empty value, so a row with no real code passes the missing-code check. One guess throws away a good row silently; the other lets a bad row through. The issue's stated expectation is that any unreadable row is reported to the user, on the grounds that a partner whose name starts that way can be a real customer or supplier.

phileggel/PatientManager#621, opened 2 November 2026, logged the same class of failure in a Rust importer: a monthly row with an empty date, or a short row, "disappears with no report". It was fixed on 15 November 2026, in two parts, and the first part is named after the rule this post is arguing for: PR #702, "fix: the Excel import reports every row it leaves out", merged from a branch called fix/621-excel-import-reports-every-row. Its description states the outcome plainly: "every row the Excel import leaves out now has its report line with its reason." The reasons it enumerates are the ordinary ones: an empty date, a short row, a malformed cell, an unmatched patient, an amount with no type.

PR #703 closed the issue the same day with the other half, which is the half that is easiest to forget. It moved the failure message out of the page body, where it had been sitting behind a native dialog, and into the window the user is actually looking at. A report nobody sees is not a report.

That is the useful shape. Not "skip fewer rows", which would break the title banner case and the blank spacer case that every real export carries. Skip what you must, and make the skip visible before or alongside the data, with the reason attached.

Where TableRune fits

TableRune imports a workbook in the browser, converts the sheet you pick to CSV, and feeds that to DuckDB-Wasm. We read the importer at origin/prod ba191d9 rather than trusting our own marketing, and then ran it: the relevant code is apps/web/src/lib/import/workbook.ts, and we called its parseWorkbook on both workbooks above with the SheetJS build TableRune pins (0.20.3, checked against the lockfile's hash).

It skips in three places, and all three are the structural kind:

  • Fully blank rows from the header down. Counted per sheet, and the count is shown in the import dialog: "2 blank rows will be skipped."
  • Cells whose address is past column XFD or row 1,048,576. Dropped and counted, with the dialog saying so: a cell past those limits "cannot exist in any real spreadsheet", as the comment on the constants puts it.
  • Rows above the header row. The header row is a guess, and the comment on the function calls it a "Best-guess 0-based index". On the workbook above it returned index 2, the row holding Code / Partner / Date / Amount, correctly stepping over the banner and the blank row.

The third one is a guess, and it is the one worth dwelling on, because the honest handling of a guess is not to avoid making it. The dialog renders the sheet, greys out the rows above the chosen header, and puts a number input next to the words "rows above it are skipped" so you can move it before anything is imported. The guess is shown, and it is overridable, and the user sees which rows it costs them.

What TableRune does not do is the semantic kind. There is no totals-row heuristic anywhere in the import path: a grep for total, subtotal, summary row and grand across the importer and the DAG builders at that commit returns nothing outside tests. There is no missing-value check that drops a row either. The run agrees with the read: six records in below the header, six records out in the CSV that goes to DuckDB, the "Tổng công ty" row and the totals row among them, and a blank-row count of zero, since there is no blank row below the header. Whether a row then means anything is a question for a filter you can see and undo, which is the part of the product that is meant to hold judgements about data.

One thing the run showed that the read did not, and it belongs to the previous section. TableRune converts through sheet_to_csv, so at ba191d9, in the copy with a cached error, the code cell of row 8 arrived in DuckDB as the text #N/A, not as an empty value. Nothing was dropped, but a query asking which rows have no code would not have counted that one: the same shape of problem as the [object Object] in the first issue below, in our own product. We fixed it while writing this post. Since edde9c9, a cell holding a spreadsheet error (#N/A, #DIV/0!, #REF! and the rest) is imported as empty, its row is still imported, and the dialog says so: "1 cell held a spreadsheet error (such as #N/A) and will be imported as empty." We re-ran the same file through the importer at that commit: the code field of row 8 is empty and the count is 1.

Two interface comments in that file say the intent out loud, on blankRows and on skippedCells: "Shown in the import dialog: never skip silently."

And the boundary on our own behaviour, which matters: TableRune counts, it does not itemise. "2 blank rows will be skipped" tells you how many and why, not which. For blank rows that is adequate, since a blank row has nothing to identify it with. For a skip that threw away content it would not be, and that is a reason to keep the semantic skips out of the importer rather than a reason to think counting solves the general problem.

What we verified, and what we did not

Measured here: the workbook above, written with openpyxl 3.1.2 (the Ubuntu 24.04 package) under Python 3.12 and read with openpyxl 3.1.2 and SheetJS 0.20.3 under Node 24, with its stored XML inspected as text so that absent cells could be distinguished from empty ones; the hand-edited copy with a cached #N/A; every reading in the table; and TableRune's parseWorkbook at ba191d9 and again at edde9c9, run on both files with that SheetJS build.

One detail from the hand-edited copy, because it shows the two readers disagreeing about the one skip that can happen below your code. We also gave that copy a tenth <row> element with no cells in it, and a <dimension> of A1:D10 to match. openpyxl reports max_row=9 and yields nine rows: it disregards the empty row. SheetJS sets the sheet's range to A1:D10 and returns ten rows, the tenth empty, and sheet_to_csv ends with a line of bare commas. Both are defensible, they are not the same, and neither takes any content with it. TableRune re-derives the range from the cells present, so its import is the same for both files.

Not tested: Excel, which is not on this machine, so what Excel writes for these rows is not a claim we make. Neither of the two issues was reproduced: both are described as their authors describe them, and attributed. .xls and .ods store rows differently and were not looked at.

No count of affected projects or reports appears anywhere in this post, and none should be inferred from the two issues named.

The practical version is short. Before you look for the bug in your reader, print the number of rows the reader handed you and the number your importer wrote. If those differ, the gap is yours, and the user should have been told about it in the same breath as the success message.