Support Polars DataFrame.unpivot schema inference
Open
dataframe
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
Calling `DataFrame.unpivot` falls back to a bare `DataFrame`, even when its output schema can be determined statically.
```python
from typing import reveal_type
import polars as pl
df = pl.DataFrame({
"region": ["East"],
"units": [12],
"price": [1.5],
})
reveal_type(df.unpivot(index="region", on=["units", "price"])) # DataFrame
```
I would expect:
```text
DataFrame[region: String, variable: String, value: Float64]
```
Reproduced on `pyrefly 1.3.0-dev.1` with Polars 1.35.2.
Contributor guide
Assessment
This issue has not been assessed yet.