Skip to content

Commit

Permalink
apacheGH-32206: GcsFileSystem::Make returns Result
Browse files Browse the repository at this point in the history
  • Loading branch information
trifleneurotic committed Oct 23, 2024
1 parent 8eccbfe commit 4d6687a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 63 deletions.
2 changes: 1 addition & 1 deletion cpp/src/arrow/filesystem/gcsfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ Result<std::shared_ptr<io::OutputStream>> GcsFileSystem::OpenAppendStream(
return Status::NotImplemented("Append is not supported in GCS");
}

std::shared_ptr<GcsFileSystem> GcsFileSystem::Make(const GcsOptions& options,
Result<std::shared_ptr<GcsFileSystem>> GcsFileSystem::Make(const GcsOptions& options,
const io::IOContext& context) {
// Cannot use `std::make_shared<>` as the constructor is private.
return std::shared_ptr<GcsFileSystem>(new GcsFileSystem(options, context));
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/filesystem/gcsfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class ARROW_EXPORT GcsFileSystem : public FileSystem {

/// Create a GcsFileSystem instance from the given options.
// TODO(ARROW-16884): make this return Result for consistency
static std::shared_ptr<GcsFileSystem> Make(
static Result<std::shared_ptr<GcsFileSystem>> Make(
const GcsOptions& options, const io::IOContext& = io::default_io_context());

private:
Expand Down
Loading

0 comments on commit 4d6687a

Please sign in to comment.