Schema assumes the column order in the data when reading a CSV #18821
Labels
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
Checks
Reproducible example
Input 1
Output 1
Input 2
Output 2
Log output
No response
Issue description
When reading a CSV file using a schema, polars assumes the order of the schema is the order of the columns in the dataframe. If the order is different and the column doesn't match the expected type it fails with the error presented. If there is no column type problem it runs with no problems and the resulting dataframe is wrong.
Expected behavior
The order of the schema may not be the same order as the columns in the file, hence the order of a schema dict should not be relevant to read the file.
Installed versions
The text was updated successfully, but these errors were encountered: