Open stinodego opened 3 months ago
import io import polars as pl df = pl.DataFrame({"a": [1.0, float("inf"), float("-inf"), float("nan")]}) ser = df.serialize() print(ser) # {"columns":[{"name":"a","datatype":"Float64","bit_settings":"","values":[1.0,null,null,null]}]} result = pl.DataFrame.deserialize(io.StringIO(ser)) print(result)
shape: (4, 1) ┌──────┐ │ a │ │ --- │ │ f64 │ ╞══════╡ │ 1.0 │ │ null │ │ null │ │ null │ └──────┘
Roundtripping float columns doesn't work for nan/inf values.
original values are preserved
main
Ah yes. That's because JSON doesn't support those values.
Checks
Reproducible example
Log output
Issue description
Roundtripping float columns doesn't work for nan/inf values.
Expected behavior
original values are preserved
Installed versions
main