Open
Description
Checks
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of Polars.
Issue description
Using a modified example from the docs, if we replace .select
with .with_columns
we do not get a rechunked series:
import polars as pl
from polars import col
df = pl.DataFrame({"a": [1, 2]})
df = df.select(pl.repeat(None, 1).append(col("a")))
# shape: (3, 1)
# ┌────────┐
# │ repeat │
# │ --- │
# │ i64 │
# ╞════════╡
# │ null │ <-- chunk 1
# │ 1 │ <-- chunk 2
# │ 2 │
# └────────┘
df.select(col("repeat").rechunk()).n_chunks()
# 1
df.with_columns(col("repeat").rechunk()).n_chunks()
# 2
Installed versions
main