rstudio / pins-r

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

Uninformative error when missing name for `pin_versions()` #656

Closed mattwarkentin closed 2 years ago

mattwarkentin commented 2 years ago

Hi,

Just wanted to let you know that the error message when forgetting to provide a name to pin_versions() left me a little confused until I realized my mistake. Please see reprex below:

library(pins)
tmp <- tempdir()
board <- board_folder(tmp, versioned = TRUE)
pin_write(board, mtcars, 'mtcars')
#> Guessing `type = 'rds'`
#> Creating new version '20220929T171212Z-66143'
#> Writing to pin 'mtcars'
pin_versions(board)
#> Error in if (file.exists(data_txt)) {: the condition has length > 1
pin_versions(board, 'mtcars')
#> # A tibble: 1 × 3
#>   version                created             hash 
#>   <chr>                  <dttm>              <chr>
#> 1 20220929T171212Z-66143 2022-09-29 11:12:12 66143
juliasilge commented 2 years ago

This is happening because of the logic to support backward compatibility for pin_versions():

https://github.com/rstudio/pins-r/blob/2bbadcda863973cc0ff0aebadfb72b786c4934bb/R/pin_versions.R#L41-L49

I tend to think the right move here is to remove the support for pin_versions() backward compatibility for the old, v0 pins. pins 1.0 was Oct 2021, so coming up on a year.

github-actions[bot] commented 1 year ago

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.