-
Notifications
You must be signed in to change notification settings - Fork 35
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
Bump rust-polars to 0.42.0 #1183
Conversation
Only 2 tests failing.
now returns both columns sorted in decreasing order and I can't figure out why (and I can't reproduce on Python) |
@eitsupi really stuck on this failure in Python 1.5.0: import polars as pl
df = pl.DataFrame({"x": [1, 2, 1, 2], "y": [1, 2, 3, 4]})
df.sort(["x", "y"], descending=[True, False])
This PR: dat = pl$DataFrame(x = c(1, 2, 1, 2), y = 1:4)
dat$sort(c("x", "y"), descending = c(TRUE, FALSE))
The same code on
|
In a8c20da, it works correctly. > dat$sort(c("x", "y"), descending = c(TRUE, FALSE))
Error:
! Evaluation failed in `$sort()`.
Caused by error in `extend_bool()` at neo-r-polars/R/lazyframe-frame.R:58:5:
! the length of `descending` (2) does not match the length of `...` (1)
Run `rlang::last_trace()` to see where the error occurred.
> dat$sort("x", "y", descending = c(TRUE, FALSE))
shape: (4, 2)
┌─────┬─────┐
│ x ┆ y │
│ --- ┆ --- │
│ f64 ┆ i32 │
╞═════╪═════╡
│ 2.0 ┆ 2 │
│ 2.0 ┆ 4 │
│ 1.0 ┆ 1 │
│ 1.0 ┆ 3 │
└─────┴─────┘ I do not know where the problem lies in the current implementation. Is it possible that there is a problem where the Lines 48 to 69 in a8c20da
|
This doesn't match the behaviour of py-polars, that accepts input as The issue is probably that these lines: let mut exprs = robj_to!(VecPLExprCol, by)?;
let mut ddd = robj_to!(VecPLExprCol, dotdotdot)?;
exprs.append(&mut ddd); transform |
Good point. |
I've done a little digging into this, and rather than try to do a complete reproduction, I think it would be best to follow the general dynamic dots rule (use > dat$sort(!!!c("x", "y"), descending = c(TRUE, FALSE))
shape: (4, 2)
┌─────┬─────┐
│ x ┆ y │
│ --- ┆ --- │
│ f64 ┆ i32 │
╞═════╪═════╡
│ 2.0 ┆ 2 │
│ 2.0 ┆ 4 │
│ 1.0 ┆ 1 │
│ 1.0 ┆ 3 │
└─────┴─────┘ |
I got it, we had already the code for I hope the rewrite is going well, I'm really confused with all those internal functions 😄
I think that's something to think about for the rewrite, but for now I'd rather keep the current behavior. I don't work a lot with Python, so overall I don't really understand the point of handling |
@eitsupi I have changed rust-version to 1.81.0 in Cargo.toml but there's still this error in CI:
Do you know how to fix it? I don't see 1.80.1 anywhere in the package so I don't know why it uses that |
Rust 1.81 is not released yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
My understanding is that this is simply due to copying from Python Polars. |
Actually I was asking for the python implementation. Maybe it's common in python, but I don't understand the point of having I think it's a weird pattern in R and it makes it harder for us to maintain because we have to ensure that |
I think this is because the things that can be specified are different. Python Polars' API is derived from pyspark, and we can find the same pattern in pyspark as well.
|
Close #1185
https://github.com/pola-rs/polars/releases/tag/rs-0.42.0
@eitsupi I think the most annoying change is the move frompl_flavor
tocompatlevel
made here: pola-rs/polars#17421