I am trying to the last example on this page, but the compiler complains no method named listfound for enumExpr in the current scope. If I comment out the list() function look at what the compiler tells me: Err(ComputeError(ErrString("this operation is likely not what you want (you may need .list())\n\nError originated in expression: 'col(\"Type 1\").slice(offset=0, length=3).over([col(\"Type 1\")])'"))). The compiler is actually telling me I need to use the .list() function, but then when I do use it, the same compiler says it cannot find a list function. How can anyone learning a new language win against that kind of compiler? Here is my full code sample:
I think you don't have the feature enabled that gates the Expr::list method: dtype-array. Try adding the dtype-array feature to your polars dependency. (not true)
The Expr::list method was added in the latest version v0.30.0 of polars, are you using the right version?
That makes sense, as I am using version 0.29.0. When I try to use v0.30.0, I get the following compilation errors:
Compiling polars-core v0.30.0
error[E0599]: no method named `is_sliced` found for reference `&Buffer<<S as PolarsNumericType>::Native>` in the current scope
--> /Users/rogerbos/.cargo/registry/src/github.com-1ecc6299db9ec823/polars-core-0.30.0/src/chunked_array/ops/apply.rs:82:35
|
82 | if owned_arr.values().is_sliced() {
| ^^^^^^^^^ help: there is a method with a similar name: `slice`
error[E0599]: no method named `is_sliced` found for reference `&Buffer<<T as PolarsNumericType>::Native>` in the current scope
--> /Users/rogerbos/.cargo/registry/src/github.com-1ecc6299db9ec823/polars-core-0.30.0/src/chunked_array/ops/extend.rs:65:25
|
65 | if arr.values().is_sliced() {
| ^^^^^^^^^ help: there is a method with a similar name: `slice`
Those errors are in the polars apply.rs and extend.rs functions, so I don't know how to fix them.
Thanks for taking the time to try it on your machine. I created a new project so I would have only the code you used and it compiled, but I got the following runtime error:
flatten: Err(ComputeError(ErrString("the length of the window expression did not match that of the group\n\nError originated in expression: 'col(\"Type 1\").slice(offset=0, length=3).over([col(\"Type 1\")])'")))