Closed stinodego closed 1 week ago
yeah, I have a very similar issue already (#12775)
It actually works if you "activate the Decimal"
pl.Config.activate_decimals(True)
pl.Series([0.1]).cast(pl.Decimal(10, 5))
shape: (1,)
Series: '' [decimal[10,5]]
[
0.10000
]
However, there is still a "bug" where the precision is not correctly inferred
pl.Series([5.67]).cast(pl.Decimal)
shape: (1,)
Series: '' [decimal[38,0]]
[
5
]
5.67
truncated to 5
Decimal
documentation says that by default the precision is inferred from the data which does not work hereThanks for the link - closing this one then!
Checks
Reproducible example
Log output
Issue description
The cast doesn't work and the dtype remains a float. No error is thrown.
Expected behavior
This cast should work.
Installed versions
main