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_write() cannot set access_type on an update for Connect #760

Closed
colearendt opened this issue Jul 31, 2023 · 5 comments · Fixed by #770
Closed

pin_write() cannot set access_type on an update for Connect #760

colearendt opened this issue Jul 31, 2023 · 5 comments · Fixed by #770

Comments

@colearendt
Copy link
Contributor

If a pin already exists, update fails when setting access_type, presumably because find() or some other method is called with the argument, and the argument is not used.

2023/07/31 2:37:38 PM: Quitting from lines 13-18 [unnamed-chunk-1] (rmd_document.Rmd)
2023/07/31 2:37:38 PM: Error in `pin_write()`:
2023/07/31 2:37:38 PM: ! Arguments in `...` must be used.
2023/07/31 2:37:38 PM: ✖ Problematic argument:
2023/07/31 2:37:38 PM: • access_type = "logged_in"
2023/07/31 2:37:38 PM: ℹ Did you misspell an argument name?
2023/07/31 2:37:38 PM: Backtrace:
2023/07/31 2:37:38 PM: 1. global refresh_pin()
2023/07/31 2:37:38 PM: 3. pins::pin_write(., leads_with_eval, name = "jss/pin_name", access_type = "logged_in")
2023/07/31 2:37:38 PM: Execution halted

@jspiewak

@jspiewak
Copy link
Member

Possible this was introduced by #735, where if the hash is the same the function returns before consuming the ....
Except the error with the ellipsis obscures the message about the hash being the same.
On the other hand, my R is only so so, so perhaps I am misreading the code.

@jspiewak
Copy link
Member

Seems like my read is accurate. I passed force_identical_write = TRUE in additional to the access_type and the error goes away.

@juliasilge
Copy link
Member

juliasilge commented Aug 7, 2023

Here is a reprex (this pin already exists):

library(pins)
b <- board_connect()
#> Connecting to Posit Connect 2023.05.0 at <https://colorado.posit.co/rsc>

b |> pin_write(
  1:10, 
  "julia.silge/some-amazing-numbers",
  access_type = "all"
)
#> Guessing `type = 'rds'`
#> ! The hash of pin "julia.silge/some-amazing-numbers" has not changed.
#> • Your pin will not be stored.
#> Error in `pin_write()`:
#> ! Arguments in `...` must be used.
#> ✖ Problematic argument:
#> • access_type = "all"
#> ℹ Did you misspell an argument name?
#> Backtrace:
#>     ▆
#>  1. └─pins::pin_write(b, 1:10, "julia.silge/some-amazing-numbers", access_type = "all")
#>  2.   └─rlang (local) `<fn>`()
#>  3.     └─rlang:::check_dots(env, error, action, call)
#>  4.       └─rlang:::action_dots(...)
#>  5.         ├─base (local) try_dots(...)
#>  6.         └─rlang (local) action(...)

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

Here I see the "better" message (The hash of pin "julia.silge/some-amazing-numbers" has not changed.) before the less helpful one about not using the access_type argument.

@juliasilge
Copy link
Member

juliasilge commented Aug 7, 2023

Except the error with the ellipsis obscures the message about the hash being the same

Are you saying you didn't see the message about the hash being the same at all? Or rather that it was hard to pick out what was going on with multiple messages here?

For folks who may be interested, we wrote about the duplicate writing behavior in this blog post.

@github-actions
Copy link

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 13, 2023
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.

3 participants