-
Notifications
You must be signed in to change notification settings - Fork 273
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
fix: list_transpose()
takes into account all elements for the template
#1136
Conversation
Code | ||
list_transpose(list(x = list(a = 1, b = 2), y = list(3, 4))) | ||
Condition | ||
Error in `fn()`: |
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.
Do you think it's worth making this error a bit more clear? At a minimum, it seems like it'd be worth wrapping it to give some context and a more useful call
.
Good catch, done. No idea how I missed committing the snapshots... |
Do you still think it's worth having a |
I think so? It's hard to tell that this message arises because by generating a default value for an argument. |
R/list-transpose.R
Outdated
vec_set_union, | ||
error_call = caller_env() | ||
indexes <- map(x, vec_index) | ||
try_fetch( |
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.
withCallingHandlers
should be adequate here.
R/list-transpose.R
Outdated
vctrs_error_ptype2 = function(e) { | ||
cli::cli_abort( | ||
"Can't combine named and unnamed vectors.", | ||
arg = template |
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.
Needs call
still?
Closes #1128. |
f6d6ec7
to
d7e21af
Compare
This introduces an error for the case when mixing named and unnamed elements, it was a silent error before.
Closes #1128.