rstudio / pins-r

Pin, Discover and Share Resources
https://pins.rstudio.com
Other
301 stars 62 forks source link

[Feature Request] Return pin version instead of name when writing #833

Open jeffkeller-einc opened 3 weeks ago

jeffkeller-einc commented 3 weeks ago

I often need to know the exact version of the pin that I just wrote so that I can pass that version explicitly to downstream operations.

I can run something like pins::pin_versions(...) |> tail(1) after writing the pin, but this runs the risk of returning the wrong version if another process has written another pin version in the meantime.

I think it would be useful if pin_write, pin_upload, pin_store.*, etc. would return the version that they wrote. They print the version to stdout, but I'd rather not parse that.

> pin_write(...)
Creating new version '20240610T134931Z-12956'
Writing to pin 'my_pin'

Instead, the write functions return (invisibly) the name of the pin. I'm not sure what utility this provides, since the name was provided to the write function already. Would it be possible to add the pin version to the output? This would allow users to read or query meta data explicitly.

juliasilge commented 3 weeks ago

Related to #592