-
Notifications
You must be signed in to change notification settings - Fork 38
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
improve unpack_list error #607
Conversation
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.
LGTM, can you add some tests and bump news?
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 for working on this.
Could you also update unpack_bool_expr
and related functions?
> pl$DataFrame(list(list(1,2,3)))
shape: (3, 1)
┌────────────┐
│ new_column │
│ --- │
│ list[f64] │
╞════════════╡
│ [1.0] │
│ [2.0] │
│ [3.0] │
└────────────┘
> pl$DataFrame(list(list(1,2,3)),"a")
shape: (1, 2)
┌───────────────────────┬──────────────┐
│ new_column ┆ new_column_1 │
│ --- ┆ --- │
│ list[list[f64]] ┆ str │
╞═══════════════════════╪══════════════╡
│ [[1.0], [2.0], [3.0]] ┆ a │
└───────────────────────┴──────────────┘ |
Apart from moving the functions dealing with |
resolves #600
this PR improves the bad error message for trailing commas for internal function
unpack_list()
.Also the function now has
.context=
and.call
args just asunwrap()
.I have provided context for any use of
unpack_list()
In future when/if extendr+polars supports/allows trailing commas. This extra error styling can be removed again.
examples