Closed philippspengler closed 1 week ago
pl.DataFrame([0.12345678]).select(pl.col('column_0').cast(pl.Decimal(scale=6)) * 1)
shape: (1, 1) ┌──────────┐ │ column_0 │ │ --- │ │ i32 │ ╞══════════╡ │ 0 │ └──────────┘
In previous versions of polars (<0.20.23), multiplying a Decimal type column with an integer resulted in a Decimal column. Since polars 0.20.23, polars converts the column to int type.
shape: (1, 1) ┌────────────────┐ │ column_0 │ │ --- │ │ decimal[*,12] │ ╞════════════════╡ │ 0.123456000000 │ └────────────────┘
@ritchie46 any chance it's from https://github.com/pola-rs/polars/pull/15879?
Ah, yes.. That's related. Will take a look.
Checks
Reproducible example
Log output
Issue description
In previous versions of polars (<0.20.23), multiplying a Decimal type column with an integer resulted in a Decimal column. Since polars 0.20.23, polars converts the column to int type.
Expected behavior
shape: (1, 1) ┌────────────────┐ │ column_0 │ │ --- │ │ decimal[*,12] │ ╞════════════════╡ │ 0.123456000000 │ └────────────────┘
Installed versions