Cannot add constant field to empty structs #21095
Labels
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
Checks
Reproducible example
Log output
Issue description
When a struct column has no fields, it cannot add extra constant field. Adding
pl.lit(42).first()
didn't help. It seems like thewith_fields
is trying to create a series of length 1.I tried forcing some non-empty data type to the struct which fixes the issue.
Expected behavior
I would expect to create a column with the same field value in each element.
Installed versions
The text was updated successfully, but these errors were encountered: