You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2023/03/07 15:27:23 UTC
[GitHub] [arrow] paleolimbot commented on a diff in pull request #34477: GH-34422: [R] Expose GcsFileSystem$options
paleolimbot commented on code in PR #34477:
URL: https://github.com/apache/arrow/pull/34477#discussion_r1128041380
##########
r/src/filesystem.cpp:
##########
@@ -422,4 +424,63 @@ std::shared_ptr<fs::GcsFileSystem> fs___GcsFileSystem__Make(bool anonymous,
return fs::GcsFileSystem::Make(gcs_opts, io_context);
}
+// [[gcs::export]]
+cpp11::list fs___GcsFileSystem__options(const std::shared_ptr<fs::GcsFileSystem>& fs) {
+ using cpp11::literals::operator"" _nm;
+
+ cpp11::writable::list out;
+
+ fs::GcsOptions opts = fs->options();
+
+ // GcsCredentials
+ out.push_back({"anonymous"_nm = opts.credentials.anonymous() });
+
+ if (opts.credentials.access_token() != "") {
+ out.push_back({"access_token"_nm = opts.credentials.access_token() });
+ }
+
+ // TODO: Cast to posixct?
Review Comment:
I would do that back in R land...you could do something like `sexp expiration = ...; expiration.attr("class") = "POSIXct"; expiration.attr("tzone") = "UTC";` but maybe safer to just do `options$expiration <- as.POSIXct(options$expiration, origin = "1970-01-01", tz = "UTC")`.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org