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

More Helpful Errors If Multiple Available #171

Closed
akgold opened this issue Feb 7, 2020 · 2 comments
Closed

More Helpful Errors If Multiple Available #171

akgold opened this issue Feb 7, 2020 · 2 comments

Comments

@akgold
Copy link
Contributor

akgold commented Feb 7, 2020

If I have multiples of the same pin available on an rsconnect board, the error when I try to get the pin without disambiguating isn't very helpful.

For example on colorado.rstudio.com, there are many versions of iris pinned with the name iris.

So I can do

> pins::pin_get("cole/iris", board = "rsconnect")
# A tibble: 150 x 5
   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
          <dbl>       <dbl>        <dbl>       <dbl> <fct>  
 1          5.1         3.5          1.4         0.2 setosa 
 2          4.9         3            1.4         0.2 setosa 
 3          4.7         3.2          1.3         0.2 setosa 
 4          4.6         3.1          1.5         0.2 setosa 
 5          5           3.6          1.4         0.2 setosa 
 6          5.4         3.9          1.7         0.4 setosa 
 7          4.6         3.4          1.4         0.3 setosa 
 8          5           3.4          1.5         0.2 setosa 
 9          4.4         2.9          1.4         0.2 setosa 
10          4.9         3.1          1.5         0.1 setosa 
# … with 140 more rows
> pins::pin_get("nathan/iris", board = "rsconnect")
# A tibble: 150 x 5
   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
          <dbl>       <dbl>        <dbl>       <dbl> <fct>  
 1          5.1         3.5          1.4         0.2 setosa 
 2          4.9         3            1.4         0.2 setosa 
 3          4.7         3.2          1.3         0.2 setosa 
 4          4.6         3.1          1.5         0.2 setosa 
 5          5           3.6          1.4         0.2 setosa 
 6          5.4         3.9          1.7         0.4 setosa 
 7          4.6         3.4          1.4         0.3 setosa 
 8          5           3.4          1.5         0.2 setosa 
 9          4.4         2.9          1.4         0.2 setosa 
10          4.9         3.1          1.5         0.1 setosa 
# … with 140 more rows

If I try to just get "iris", the error message isn't helpful. Would it be possible to provide a message stating that disambiguation is required?

> pins::pin_get("iris", board = "rsconnect")
Error in board_pin_get.rsconnect(board_get(board), name, ...) : 
  The pin 'iris' is not available in the 'rsconnect' board.
@akgold
Copy link
Contributor Author

akgold commented Feb 7, 2020

It looks like this works fine in pin_find...so maybe just returning the results of pin_find, or even just suggesting that they run pin_find would work.

javierluraschi added a commit that referenced this issue Feb 21, 2020
Improve error message in rsconnect boards with dupe names to fix #171
@github-actions
Copy link

github-actions bot commented Sep 2, 2022

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant