Skip to content
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

make error message more useful when passing a 0-length grouping variable #1212

Closed
2 tasks done
kendonB opened this issue Mar 11, 2020 · 0 comments
Closed
2 tasks done
Assignees

Comments

@kendonB
Copy link
Contributor

kendonB commented Mar 11, 2020

Prework

Proposal

When I pass a grouping variable of length 0, the current error message is There are only 0 elements.

I propose to change this to There are only 0 elements in grouping variable <object_name>.

library(drake)
my_plan <- drake_plan(
  i = numeric(),
  mytarget = target({
    1
  }, dynamic = map(i))
)
make(my_plan)
#> ▶ target i
#> ▶ dynamic mytarget
#> > subtarget mytarget_
#> Error: Must index existing elements.
#> x Can't subset position 1.
#> ℹ There are only 0 elements.

Created on 2020-03-11 by the reprex package (v0.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants