amoeba commented on code in PR #34524:
URL: https://github.com/apache/arrow/pull/34524#discussion_r1140646873
##########
r/R/filesystem.R:
##########
@@ -572,6 +572,11 @@ GcsFileSystem$create <- function(anonymous = FALSE,
retry_limit_seconds = 15, ..
options$retry_limit_seconds <- retry_limit_seconds
+ # Handle reading json_credentials from the filesystem
+ if ("json_credentials" %in% names(options) &&
file.exists(options[["json_credentials"]])) {
+ options[["json_credentials"]] <-
paste(readLines(options[["json_credentials"]]), collapse = "")
Review Comment:
> I forget the exact details but I think readLines() assumes system encoding
(rather than UTF-8, which matters on Windows). Any thought as to which one of
those is a better assumption if the value points to a file? (The workaround
would be for the user to read in the file themselves first with an explicit
encoding).
Thanks for catching this point. You're right about readLines' behavior. To
your question, I'm not entirely sure. If I test on my Windows 11 VM, the
system-wide encoding is Windows 1252, but JSON files downloaded via Edge
produces either ASCII or UTF-8 files. Maybe this just works or maybe just works
on newer Win10/11 builds?
> Also, did you want to collapse = "\n"?
I suppose that's slightly better, though I think either works just the same.
I'll change it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]