Incorrectly Sized Series of Struct returned from Plugin #19283
Labels
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
rust
Related to Rust Polars
Checks
Reproducible example
Log output
No response
Issue description
This was done with polars-u64-idx
When trying to follow the pattern demonstrated here: https://github.com/pola-rs/pyo3-polars/blob/d426148ae27410aa4fb10a4a9dc67647a058244f/example/derive_expression/expression_lib/src/expressions.rs
I found that directly returning a series of just a primitive type like in the example worked correctly, but when trying to return a series of struct like in the above it is incorrectly sized (in the above example 100 -- 2000 / 20), and is instead the size of the single last chunk that was to be processed. - So if instead of using
range(2000)
I usedrange(1999)
it would be of length 99Printing out s.len() within the plugin returns the correct length, but once it comes back into dataframe form it is no longer the correct length. If instead of going through the chunking process with the downcasting and the rest and instead directly returning the construted struct works propery.
Expected behavior
It should return the full length series regardless of wrapping them in structs
Installed versions
["dtype-struct", "dtype-i8", "dtype-array", "dtype-i16", "bigidx"]
--------Version info---------
Polars: 1.9.0
Index type: UInt64
Platform: Linux-6.8.0-45-generic-x86_64-with-glibc2.31
Python: 3.11.9 (main, Oct 8 2024, 17:30:19) [GCC 13.1.0]
----Optional dependencies----
adbc_driver_manager
altair
cloudpickle 3.0.0
connectorx
deltalake
fastexcel
fsspec 2023.9.2
gevent
great_tables
matplotlib 3.9.2
nest_asyncio 1.6.0
numpy 1.26.4
openpyxl
pandas 2.2.3
pyarrow 17.0.0
pydantic 2.9.2
pyiceberg
sqlalchemy
torch 2.4.1+cu124
xlsx2csv
xlsxwriter
The text was updated successfully, but these errors were encountered: