You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/20 21:24:53 UTC

[GitHub] [arrow] kou commented on a diff in pull request #12763: ARROW-14892: [Python][C++] GCS Bindings

kou commented on code in PR #12763:
URL: https://github.com/apache/arrow/pull/12763#discussion_r854562022


##########
cpp/src/arrow/util/config.h.cmake:
##########
@@ -45,6 +45,7 @@
 #cmakedefine ARROW_IPC
 #cmakedefine ARROW_JSON
 
+#cmakedefine ARROW_GCS

Review Comment:
   Could you also update document for `FileSystemFromUri`like https://github.com/apache/arrow/pull/12932/files#diff-82a2d9a8424dfb436344c0802dc36275cd0fb87e2e9eb6399745fba43799f7e5 ?



##########
dev/tasks/tasks.yml:
##########
@@ -431,7 +431,7 @@ tasks:
 {############################## Wheel OSX ####################################}
 
 # enable S3 support from macOS 10.13 so we don't need to bundle curl, crypt and ssl
-{% for macos_version, macos_codename, arrow_s3 in [("10.9", "mavericks", "OFF"),
+{% for macos_version, macos_codename, arrow_s3_gcs in [("10.9", "mavericks", "OFF"),

Review Comment:
   I have a strong opinion for this but I like adding a new variable for `gcs` for readability:
   
   ```text
   {% for macos_version, macos_codename, arrow_s3, arrow_gcs in [("10.9", "mavericks", "OFF", "OFF"),
                                                                 ("10.13", "high-sierra", "ON", "ON")] %}
   ```



##########
.github/workflows/cpp.yml:
##########
@@ -276,7 +276,7 @@ jobs:
       ARROW_GANDIVA: ON
       # google-could-cpp uses _dupenv_s() but it can't be used with msvcrt.
       # We need to use ucrt to use _dupenv_s().
-      # ARROW_GCS: ON
+      ARROW_GCS: OFF

Review Comment:
   Could you revert this change because `ARROW_GCS` is `OFF` by default in `ci/scripts/cpp_build.sh`?



##########
cpp/src/arrow/filesystem/gcsfs.cc:
##########
@@ -690,11 +763,19 @@ Result<GcsOptions> GcsOptions::FromUri(const arrow::internal::Uri& uri,
     options_map.emplace(kv.first, kv.second);
   }
 
-  if (!uri.password().empty() || !uri.username().empty()) {
-    return Status::Invalid("GCS does not accept username or password.");
+  const std::string& username = uri.username();
+  bool anonymous = username == "anonymous";
+  if (!username.empty() && !anonymous) {
+    return Status::Invalid("GCS URIs do not accept username except \"anonymous\".");
+  }
+  if (!uri.password().empty()) {
+    return Status::Invalid("GCS URIs do not accept password.");
+  }
+  if (!uri.password().empty()) {
+    return Status::Invalid("GCS URIs do not accept password.");
   }

Review Comment:
   It seems that this is duplicated code.



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