-
Notifications
You must be signed in to change notification settings - Fork 36
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
Enable $explode()
for Data/LazyFrame
#314
Conversation
Merge branch 'main' into dataframe-explode # Conflicts: # tests/testthat/test-lazy.R
@etiennebacher I have improved robj_to! a bit . Ideally use of
> err = pl$DataFrame(list(a = list(1:3,11:12)))$explode(list("a",complex())) |>
+ result() |>
+ unwrap_err()
>
> #get contexts, call and info
> err$contexts()
$BadArgument
[1] "columns"
$Hint
[1] "element no. [2] "
$PlainErrorMessage
[1] "cannot be converted into an Expr"
$BadValue
[1] "Rvalue: [], Rsexp: Complexes, Rclass: [\"complex\"]"
$PlainErrorMessage
[1] "cannot make a column expression from: cplx(0) "
> err$get_rcall()
[1] "unwrap_err(result(pl$DataFrame(list(a = list(1:3, 11:12)))$explode(list(\"a\", \n complex()))))"
> err$get_rinfo()
[1] "in explode():"
> |
showcase new catch any R error > showcase = function() {
stop("imma simple R err") |>
result() |> #catch result and upgrade any raised error to RPolarsErr
map_err(\(err) err$
plain("happend while showcasing RPolarsErr")$
when("talking about RPolarsErr")
) |>
unwrap(" in showcase:")
}
> showcase()
Error: Execution halted with the following contexts
0: In R: in showcase:
0: During function call [showcase()]
1: When talking about RPolarsErr
2: happend while showcasing RPolarsErr
3: imma simple R err |
New error handling looks really nice! |
$explode()
for Data/LazyFrame
$explode()
for Data/LazyFrame
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 @etiennebacher ! Looks good.
Requested to merge after 308. Merging whenever also ok I think.
$explode()
for Data/LazyFrame
$explode()
for Data/LazyFrame
To merge after #308. I just followed the code for
sort_by()