Issue with UDF Return Type Change in Latest Polars Version #20742
Labels
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
regression
Issue introduced by a new release
Checks
Reproducible example
Log output
Issue description
I recently upgraded from Polars 1.8.0 to the latest version and encountered an error with my existing code.
Previously, I could return
dict[str, pl.Series[float]]
from the UDF without any issues. However, after upgrading, this code throws an error, and I now need to returndict[str, list[float]]
.This change requires using
{"a": list(x1.cumsum())}
, which involves a memory copy, whereas pl.Series did not, resulting in a significant performance difference.Is this a bug or an intended feature? If this is the new expected behavior, how should I modify my code accordingly?
Expected behavior
output:
Installed versions
The text was updated successfully, but these errors were encountered: