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/02/04 17:58:22 UTC

[GitHub] [arrow] paleolimbot commented on a diff in pull request #34009: GH-33904: [R] improve behavior of s3_bucket - work-around

paleolimbot commented on code in PR #34009:
URL: https://github.com/apache/arrow/pull/34009#discussion_r1096567202


##########
r/R/filesystem.R:
##########
@@ -462,12 +462,13 @@ s3_bucket <- function(bucket, ...) {
   if (!is_url(bucket)) {
     bucket <- paste0("s3://", bucket)
   }
-  fs_and_path <- FileSystem$from_uri(bucket)
-  fs <- fs_and_path$fs
+
+  if (!length(args)) {
+    fs_and_path <- FileSystem$from_uri(bucket)
+    fs <- fs_and_path$fs
+  } else {
   # If there are no additional S3Options, we can use that filesystem
-  # Otherwise, take the region that was detected and make a new fs with the args
-  if (length(args)) {
-    args$region <- fs$region
+  # If user specifies args, they must specify region as arg, env var, or config
     fs <- exec(S3FileSystem$create, !!!args)

Review Comment:
   Looks like you need to define `fs_and_path` here somehow?



-- 
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