CSV reader column projection does not respect order #10572
Labels
A-io
Area: reading and writing data
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Reproducible example
gives output
Issue description
The
columns
parameter ofpl.read_csv
does not project the columns in the right order in the resulting dataframe.This is especially jarring when specifying both
columns
andnew_columns
, thenew_columns
still renames the columns as per the order they appeared in the CSV, rather than the order specified incolumns
. I would expectcolumns
to first do a projection after whichnew_columns
renames them in the same order ascolumns
was specified.Expected behavior
Installed versions
I can reproduce on
main
.The text was updated successfully, but these errors were encountered: