rstudio / pins-r

Pin, discover, and share resources
https://pins.rstudio.com
Other
312 stars 63 forks source link

Add a better error for `pin_versions()` #657

Closed juliasilge closed 2 years ago

juliasilge commented 2 years ago

Closes #656

library(pins)
tmp <- tempdir()
board <- board_folder(tmp, versioned = TRUE)
pin_write(board, mtcars, 'my-beautiful-cars')
#> Guessing `type = 'rds'`
#> Creating new version '20220930T035916Z-66143'
#> Writing to pin 'my-beautiful-cars'
pin_versions(board)
#> Error in `pin_versions()`:
#> ! Argument `name` is missing, with no default

#> Backtrace:
#>     ▆
#>  1. └─pins::pin_versions(board)
#>  2.   └─rlang::abort("Argument `name` is missing, with no default") at pins-r/R/pin_versions.R:42:4
pin_versions(board, 'my-beautiful-cars')
#> # A tibble: 1 × 3
#>   version                created             hash 
#>   <chr>                  <dttm>              <chr>
#> 1 20220930T035916Z-66143 2022-09-29 21:59:16 66143

Created on 2022-09-29 with reprex v2.0.2

We decided that we're not ready to deprecate or remove any of the code that keeps the v0 interface working, so for the time being, let's add more logic for this improved error.

github-actions[bot] commented 1 year ago

This pull request 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.