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 error due to duplicate folder name in gdrive #818

Closed
UchidaMizuki opened this issue Jan 11, 2024 · 1 comment · Fixed by #819
Closed

pin_write error due to duplicate folder name in gdrive #818

UchidaMizuki opened this issue Jan 11, 2024 · 1 comment · Fixed by #819

Comments

@UchidaMizuki
Copy link
Contributor

In gdrive_board, pin_write throws an error when there are folders with duplicate folder names with the board.
The error also occurs for shortcuts and between folders of different hierarchies.

The cause of the error seems to be that pins:::gdrive_mkdir uses name of the board's dribble instead of its id.
The error occurs as follows,

library(pins)
library(googledrive)
drive_auth("[email protected]")

board <- board_gdrive(as_id("11wUPQi82qsXArmMeu3ENdUK_QvdU1rMv"))
board |> 
  pin_write(iris, "iris")
#> Guessing `type = 'rds'`
#> Creating new version '20240111T105439Z-d16b7'
#> Error in `as_parent()`:
#> ! Parent specified via `path` is invalid:
#> ✖ Doesn't uniquely identify exactly one folder or shared drive.
#> Backtrace:
#>      ▆
#>   1. └─pins::pin_write(board, iris, "iris")
#>   2.   ├─pins::pin_store(...)
#>   3.   └─pins:::pin_store.pins_board_gdrive(...)
#>   4.     └─pins:::gdrive_mkdir(board$dribble$name, name)
#>   5.       └─googledrive::drive_mkdir(name, dir, overwrite = FALSE)
#>   6.         └─googledrive::drive_create(...)
#>   7.           └─googledrive:::as_parent(path)
#>   8.             └─googledrive:::drive_abort(c(invalid_parent, x = "Doesn't uniquely identify exactly one folder or shared drive."))
#>   9.               └─cli::cli_abort(message = message, ..., .envir = .envir)
#>  10.                 └─rlang::abort(...)

Created on 2024-01-11 with reprex v2.0.2

UchidaMizuki added a commit to UchidaMizuki/pins-r that referenced this issue Jan 11, 2024
juliasilge added a commit that referenced this issue Jan 13, 2024
* Fix `gdrive_mkdir()' (#818)

* Update NEWS

---------

Co-authored-by: Julia Silge <[email protected]>
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 Jan 28, 2024
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.

1 participant