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

how to extend versioning in a board #265

Closed
ponkoscel opened this issue Jul 8, 2020 · 5 comments · Fixed by #266
Closed

how to extend versioning in a board #265

ponkoscel opened this issue Jul 8, 2020 · 5 comments · Fixed by #266

Comments

@ponkoscel
Copy link

Hi,

Do you have any guidance on how to extend/implement versioning for a custom board?

It does not appear in this example: https://cran.r-project.org/web/packages/pins/vignettes/boards-extending.html

Attempting something like this:

#' @title pin_versions
#' @description retrieve the pin versions
#' @param board the "my_board" base board, initialized with the users connection parameters
#' @param name the name of the resource to delete, e.g. "iris"
#' @param ... extra parameters
#' @export
board_pin_versions.my_board <- function(board, name, ...) {
board_versions_get(board, name)
}

works, but only if I source this function after either loading my extended board with devtools::load_all() or by sourcing this function after installing my custom board package. Thanks!

@javierluraschi
Copy link
Contributor

If you create an R package and export the board_pin_versions.my_board function, that should be enough for users to use pin_versions() when using your custom board.

BTW. The easiest way to create a board extension is to reuse the datatxt_board, which requires implementing GET/PUT/DELETE HTTP methods. Although, this only works for boards that have an HTTP API similar to the various cloud providers. Otherwise you would have to implement all the board methods by hand.

@javierluraschi
Copy link
Contributor

Also, is there a particular error you are hitting? I'm assuming this is a generic question, but otherwise let me know.

@ponkoscel
Copy link
Author

Thanks for the quick response. We implemented a custom board as it requires accessing another platform using the platforms specific APIs. The code above only works in conjunction with our custom board, if I use devtools::load_all(), and then source the above function. Then I can retrieve the resource versions from the server. However, if I install my custom board package from our package server OR I run devtools::load_all() and do not source the function above I simply get an empty tibble.

@javierluraschi
Copy link
Contributor

Looks like board_pin_versions() was not being exported from the pins package, I'll merge this fix later today, you can then install this with remotes::install_github("rstudio/pins").

We just pushed to CRAN a minor release, so it will take another month to get this fix into CRAN.

javierluraschi added a commit that referenced this issue Jul 9, 2020
Export board_pin_versions for extensions and fix #265
@github-actions
Copy link

github-actions bot commented Sep 1, 2022

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.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants