Problem
We have filenames store in gcs with id wrapped in curly braces, something-something-{uniq-id}.json, in the filename (I know that is not ideal but nothing I can do about it). Currently when I try to download any of those files with gcs_get_object it will fail with an error like so:
Error in `"id" %in% names(args)`:
! Could not parse cli `{}` expression: `ec548a47-cc1c-497b-…`.
Caused by error in `parse(text = code, keep.source = FALSE)`:
! <text>:1:18: unexpected symbol
1: ec548a47-cc1c-497b
^
After looking at the code, I see that it's failing this line:
|
cli::cli_process_start(paste("Downloading", URLdecode(object_name))) |
It's trying to interpolate the id within the curly braces. To solve that I tried passing it in as something-something-{{ uniq-id }}.json so that it will work with that line but that causes issues with downloading the actual file since it will now read the file name as something-something-{{ uniq-id }}.json and is getting 404 not found.
Some Suggested solution
-
Accounting for {} by sanitizing it before passing it into that line without changing the file name. i.e parse the filename and add extra {} when filenames with {} are passed. Preferred solution.
-
Add option to not print off logs and bypass that line completely.
Problem
We have filenames store in gcs with id wrapped in curly braces,
something-something-{uniq-id}.json, in the filename (I know that is not ideal but nothing I can do about it). Currently when I try to download any of those files withgcs_get_objectit will fail with an error like so:After looking at the code, I see that it's failing this line:
googleCloudStorageR/R/objects.R
Line 258 in 9cf65e5
It's trying to interpolate the id within the curly braces. To solve that I tried passing it in as
something-something-{{ uniq-id }}.jsonso that it will work with that line but that causes issues with downloading the actual file since it will now read the file name assomething-something-{{ uniq-id }}.jsonand is getting 404 not found.Some Suggested solution
Accounting for
{}by sanitizing it before passing it into that line without changing the file name. i.e parse the filename and add extra{}when filenames with{}are passed. Preferred solution.Add option to not print off logs and bypass that line completely.