read_csv handles empty lines differently in 0.20.6 leadingrows of Null #14271
Labels
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
Checks
Reproducible example
Log output
Issue description
I have some malformed CSV files, which contains an empty line between every line with data. Up until polars 0.20.5 I could just read this file and all the empty lines would be discarded. When going to 0.20.6 the lines would be included as rows with all Nulls.
Expected behavior
I would think that a line without any separator, should be discarded, or there should be a way to handle this in the read_csv function, like a "skip empty lines" parameter. If the line contains the separators but otherwise is empty, I would expect it to end up as a Null row.
I could of course do something like:
But that just feels like a workaround.
The column with all Nulls in the table shown, is expected as there is an extra separator in each row, indicating an extra value. And could be skipped by setting "columns" in the read_csv function
Installed versions
The text was updated successfully, but these errors were encountered: