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

pin_upload doesn't allow 'name' to be fully specified with username prefix #847

Closed
tommarshall2 opened this issue Oct 7, 2024 · 2 comments · Fixed by #852
Closed

pin_upload doesn't allow 'name' to be fully specified with username prefix #847

tommarshall2 opened this issue Oct 7, 2024 · 2 comments · Fixed by #852
Labels
bug an unexpected problem or unintended behavior

Comments

@tommarshall2
Copy link

If there are two content items on a Connect board with the same name, the 'name' of the pin to upload to must be qualified by the username. However, pin_upload uses the pins:::check_pin_name function, which doesn't allow for slashes in the name.

Example

I am working with a shared Posit Connect environment, where there are two pins:

  1. 'example-user-1/the_pin_name'
  2. 'example-user-2/the_pin_name'

Attempting:

library(pins)
board <- board_connect()
pin_upload(board, "data/a_data_file.fst", name = "the_pin_name")

Results in:

Error in `rsc_content_find()`:
! Multiple pins with name "the_pin_name"
ℹ Use a fully specified name including user name like "julia/the_pin_name"

But trying:

library(pins)
board <- board_connect()
pin_upload(board, "data/a_data_file.fst", name = "example-user-1/the_pin_name")

Results in:

Error in `check_pin_name()`:
! `name` must not contain slashes
@juliasilge
Copy link
Member

We use check_pin_name() in all the board-specific pin_store methods, but then we also have it here in pin_upload():

check_pin_name(name)

It would make more sense for us to treat the relationship between pin_upload() and pin_check_name() as the relationship between pin_write() and pin_check_name(), i.e. it is called from the pin_store method and not directly in the function.

@juliasilge juliasilge added the bug an unexpected problem or unintended behavior label Dec 11, 2024
@juliasilge
Copy link
Member

Hello there @tommarshall2! 👋 Would you like to try out a possible solution I have set up in #852? You can install with devtools::install_github("rstudio/pins-r@do-not-check-pin-name-in-pin-upload").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants