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

Use base R deparse() when writing plumber.R #241

Merged
merged 3 commits into from
Sep 8, 2023
Merged

Conversation

juliasilge
Copy link
Member

Closes #239

With this change, I now can correctly generate code for a board_url().

library(pins)
b <- board_url(c(
  chicago_model = 'https://colorado.posit.co/rsc/chicago-rstats-model-pin/'
))

deparse(board_deparse(b))
#> [1] "board_url(c(chicago_model = \"https://colorado.posit.co/rsc/chicago-rstats-model-pin/\"))"

Created on 2023-09-07 with reprex v2.0.2

@juliasilge
Copy link
Member Author

The tests all pass still, and I just made a plumber.R that looks like this:

# Generated by the vetiver package; edit with care

library(pins)
library(plumber)
library(rapidoc)
library(vetiver)
b <- board_url(c(chicago_model = "https://colorado.posit.co/rsc/chicago-rstats-model-pin/"))
v <- vetiver_pin_read(b, "chicago_model")

#* @plumber
function(pr) {
    pr %>% vetiver_api(v)
}

@juliasilge juliasilge merged commit 4efe187 into main Sep 8, 2023
9 checks passed
@juliasilge juliasilge deleted the use-plain-old-deparse branch September 8, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with board_deparse for board_url()
1 participant