polars icon indicating copy to clipboard operation
polars copied to clipboard

fix: Allow parsing csv file which doesn't has a header and has rows with variable number of columns

Open Nagaprasadvr opened this issue 1 year ago • 1 comments

Issue: https://github.com/pola-rs/polars/issues/1505

Description : When we pass a csv file without a header and has rows with variable length columns , the parser assumes to create a header based on first row of the csv file . But this can cause issue because other rows can have more columns than the first one and it can lead to error.

Fix : While creating headers consider the row with maximum columns and create headers accordingly

Test: 1.There is a new test added to io::cvs::test_read_csv_file_without_headers_and_non_uniform_col_len 2. checkout the new csv headerless.csv in examples/datasets/headerless for this test

Nagaprasadvr avatar Jan 26 '24 11:01 Nagaprasadvr

can u guys review this when free! ty

Nagaprasadvr avatar Feb 12 '24 03:02 Nagaprasadvr