Incorrect dtype of object of polars into-df
when numeric and null values are mixed.
#12726
Labels
🐛 bug
Something isn't working
dataframe
issues related to the dataframe implementation
needs-triage
An issue that hasn't had any proper look
Describe the bug
Discovered by @maxim-uvarov
Converting to a dataframe with null and numeric values results in the dataframe column being of dtype object. Futhermore, when attempting to apply a schema, the column still of dtype object.
Ideally, the Value::Nothing types should be converted to NaN polars values when the rest of the table is numeric. Though, this could be problematic when inferring the schema.
Minimally, an error should be returned when a column cannot be created as the type provided by the schema.
How to reproduce
[[a b]; [6 2] [1 1] [1 4] [2 null]] | polars into-df --schema {a: i64, b: i64} | polars schema
Expected behavior
Screenshots
Configuration
Additional context
Added to the Polars roadmap backlog
The text was updated successfully, but these errors were encountered: