Skip to content

fix: preserve data when parsing headerless CSV - #144

Open
Shubham-Padkonde wants to merge 1 commit into
google:masterfrom
Shubham-Padkonde:fix/headerless-csv-first-row
Open

Shubham-Padkonde wants to merge 1 commit into
google:masterfrom
Shubham-Padkonde:fix/headerless-csv-first-row

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

CsvToTable(..., header=False) discards the first data row and does not populate the generated header: assigning a dictionary to an empty Row's values only updates existing keys. A second row then fails with a length mismatch.

Create the numeric header entries explicitly and let the first line proceed through the normal row-append path. Also keep the header's row number at zero instead of overwriting it for every data row; NewRow() already assigns the correct data-row number.

Tests cover one-row and multiple-row inputs, comments, text and byte streams, and row numbering in both header modes. The new cases fail before the fix. All 103 tests pass afterward; git diff --check passes.

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.

1 participant