The solution is to pass a polars DataFrame from python, instead of a PyDataFrame, and avoid polars version 1.32.3 (there seems to be a bug)
Thank you @Carcigenicate for the help