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

Can we add more context for Can't rename in this context errors? #336

Open
DavisVaughan opened this issue Feb 22, 2023 · 0 comments
Open

Comments

@DavisVaughan
Copy link
Member

This came up in tidyverse/dplyr#6745

We've started using allow_rename = FALSE more often when our interfaces use tidy selection purely for selection (i.e. when we don't allow named inputs for possible renaming), so this error has popped up more often.

I think it would be useful if we could mention the expression causing the issue, like how we do here:

library(tidyselect)
library(rlang)

eval_select(expr(all_of(x)), mtcars)
#> Error:
#> ! Problem while evaluating `all_of(x)`.
#> Caused by error in `as_indices_impl()`:
#> ! object 'x' not found

I'm imagining something like this for tidyverse/dplyr#6745:

#> Error in `rename_with()`:
#> ! Problem while evaluating `all_of(x)`.
#> ! Can't rename variables in this context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant