Skip to content

Commit

Permalink
ARROW-14311: [C++] Make GCS FileSystem tests faster
Browse files Browse the repository at this point in the history
Avoid using the default credentials for the unit test. In some
environments these can be very slow to initialize, as they test several
different potential sources of credentials, some including HTTP
requests.

Closes #11406 from coryan/ARROW-14311-GCS-filesystem-now-uses-insecure-credentials-for-http

Authored-by: Carlos O'Ryan <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
coryan authored and kou committed Oct 26, 2021
1 parent 1bac505 commit 1b7178d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cpp/src/arrow/filesystem/gcsfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ class GcsInputStream : public arrow::io::InputStream {

google::cloud::Options AsGoogleCloudOptions(const GcsOptions& o) {
auto options = google::cloud::Options{};
std::string scheme = o.scheme;
if (scheme.empty()) scheme = "https";
if (scheme == "https") {
options.set<google::cloud::UnifiedCredentialsOption>(
google::cloud::MakeGoogleDefaultCredentials());
} else {
options.set<google::cloud::UnifiedCredentialsOption>(
google::cloud::MakeInsecureCredentials());
}
if (!o.endpoint_override.empty()) {
std::string scheme = o.scheme;
if (scheme.empty()) scheme = "https";
if (scheme == "https") {
options.set<google::cloud::UnifiedCredentialsOption>(
google::cloud::MakeGoogleDefaultCredentials());
} else {
options.set<google::cloud::UnifiedCredentialsOption>(
google::cloud::MakeInsecureCredentials());
}
options.set<gcs::RestEndpointOption>(scheme + "://" + o.endpoint_override);
}
return options;
Expand Down

0 comments on commit 1b7178d

Please sign in to comment.