Skip to content

Commit 396e6de

Browse files
committed
Fix. Add the failing case
1 parent 6247580 commit 396e6de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/_libs/src/parser/tokenizer.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,10 @@ static int end_line(parser_t *self) {
413413
return 0;
414414
}
415415

416-
if (!(self->lines <= self->header_end + 1) && (fields > ex_fields) &&
417-
!(self->usecols)) {
416+
bool past_headers = (self->lines > self->header_end + 1) ||
417+
(self->lines == 1 && self->header_end == 0);
418+
419+
if (past_headers && (fields > ex_fields) && !(self->usecols)) {
418420
// increment file line count
419421
self->file_lines++;
420422

0 commit comments

Comments
 (0)