-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
polars filter-with $mask
won't work
#12863
Comments
No issues for me. ❯ let new = [9 8 4] | polars into-df
❯ $new
╭─#─┬─0─╮
│ 0 │ 9 │
│ 1 │ 8 │
│ 2 │ 4 │
╰───┴───╯
❯ let mask = $new == 8
❯ $mask
╭─#─┬───0───╮
│ 0 │ false │
│ 1 │ true │
│ 2 │ false │
╰───┴───────╯
❯ $new | polars filter-with $mask
╭─#─┬─0─╮
│ 0 │ 8 │
╰───┴───╯ Built yesterday
|
Thank you for checking, @fdncred I'm sorry, I might have messed up with something, but I checked and recompiled everything for more than 3 times and I'm still getting the error. Maybe it is mac related :( > git pull
> cargo install --path . --features=dataframe
> nu
> cd crates/nu_plugin_polars
> cargo install --path .
> plugin add '/Users/user/.cargo/bin/nu_plugin_polars'
> nu
> let new = [9 8 4] | polars into-df
∙ let mask = $new == 8
∙ $new | polars filter-with $mask
Error: nu::shell::cant_convert
× Can't convert to NuExpression.
╭─[entry #1:3:27]
2 │ let mask = $new == 8
3 │ $new | polars filter-with $mask
· ──┬──
· ╰── can't convert NuDataFrameCustomValue to NuExpression
╰────
|
Let me recompile the plugin + nushell again and see. |
It seems like I made a mistake with git, my nushell git commit is still old. c54d223 |
oops, you're right. The latest version of the plugin doesn't work for this example. The older version of the plugin I was running did work. Not sure what version that was. ❯ let new = [9 8 4] | polars into-df
❯ let mask = $new == 8
❯ $new | polars filter-with $mask
Error: nu::shell::cant_convert
× Can't convert to NuExpression.
╭─[entry #3:1:27]
1 │ $new | polars filter-with $mask
· ──┬──
· ╰── can't convert NuDataFrameCustomValue to NuExpression
╰──── |
I checked this example on the |
I had a look at the source code and it looks like |
Describe the bug
@ayax79 I compiled nushell and
polars
from the latest main (including commit 9836998)However
polars
won't accept the example from the book, that was previously working (see below)How to reproduce
Expected behavior
I expect
polars
to filter the$new
dfScreenshots
No response
Configuration
Additional context
No response
The text was updated successfully, but these errors were encountered: