rstudio / pins-r

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

Add `board_deparse` generic #523

Closed juliasilge closed 3 years ago

juliasilge commented 3 years ago

This PR adds a board_deparse generic that will generate a character string of R code from a board object, like so:

library(pins)

b <- board_rsconnect()
#> Connecting to RSC 1.9.0.1 at <https://colorado.rstudio.com/rsc>
board_deparse(b)
#> board_rsconnect(server = "colorado.rstudio.com")

Created on 2021-09-24 by the reprex package (v2.0.1)

This will be helpful for when we use a pin locally and need to write code to access the same pin from another machine.

This draft right only implements board_deparse for RStudio Connect and shows how we would use it in the RSC bundle. I put the generic in board.R since it applies to all boards but I could make a new deparse.R if you prefer.

Still TODO, after any changes needed here:

Anything else?

juliasilge commented 3 years ago

I have this working pretty nicely for S3, I think:

library(pins)

b <- board_s3("pins-test-julia", region = "us-east-2")
board_deparse(b)
#> board_s3(bucket = "pins-test-julia", region = "us-east-2")

Created on 2021-09-24 by the reprex package (v2.0.1)

I don't have the env variables and such to be able to regenerate the snapshots for RSC and S3. Why is the CI all green if I added tests but didn't update the snapshots? (I did update snapshots for board_local() and board_url() which by the way just errors.)

Still TODO is Azure, for which I don't have an account so I'll be doing a bit of blindly stabbing in the dark.

Is it useful to have this for Kaggle?

juliasilge commented 3 years ago

Here are some open questions to answer/confirm/address:

hadley commented 3 years ago
hadley commented 3 years ago

@juliasilge can you take one last pass through this please? (I'm aiming for submission on Friday.

juliasilge commented 3 years ago

I installed from this branch again and ran through all the setups I have -- everything is working 👍

github-actions[bot] commented 2 years 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.