Menu

My import tool said row 347. The bug was on row 348
📰

My import tool said row 347. The bug was on row 348

DEV Community: fastapi·Adel Abdelaziz Goucem·10 days ago
#wcxU6CFp
#devtofastapi#devto#dev#line#blank
Reading 0:00
15s threshold

My free HR dashboard makes one small, specific promise: when a row in your Excel file is invalid, the import report gives its exact line number, the one Excel shows. While recording a demo, I fed it a file whose row 348 was wrong. The report said row 347.

This post covers why that happened, the few lines that fixed it, and the tests that keep it from coming back. The code comes from HR Dashboard Lite , a free FastAPI and Pandas project (MIT).

A realistic export

HR exports are rarely clean tables. The file I used has a title line, a blank line, then the header, then the data:

Excel row Content

1 Fichier du personnel — données fictives (title)

2 (blank)

3 Matricule , Nom et prénom , Date d'embauche , Date de départ … (header)

4 first employee

348 hired 14/06/2021, left 01/03/2019: impossible, so the row must be rejected

The importer detects the header on its own, so the user never has to say where the data starts.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.