Skip to content

Commit

Permalink
GH-32206: Removing ValueOrStop for R (GcsFileSystem).
Browse files Browse the repository at this point in the history
  • Loading branch information
trifleneurotic committed Oct 26, 2024
1 parent 227135f commit 0ccb95d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions cpp/src/arrow/filesystem/gcsfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,11 @@ Result<std::shared_ptr<io::OutputStream>> GcsFileSystem::OpenAppendStream(
return Status::NotImplemented("Append is not supported in GCS");
}

Result<std::shared_ptr<GcsFileSystem>> GcsFileSystem::Make(const GcsOptions& options,
const io::IOContext& context) {
Result<std::shared_ptr<GcsFileSystem>> GcsFileSystem::Make(
const GcsOptions& options, const io::IOContext& io_context) {
// Cannot use `std::make_shared<>` as the constructor is private.
return std::shared_ptr<GcsFileSystem>(new GcsFileSystem(options, context));
std::shared_ptr<GcsFileSystem> ptr(new GcsFileSystem(options, io_context));
return ptr;
}

GcsFileSystem::GcsFileSystem(const GcsOptions& options, const io::IOContext& context)
Expand Down
2 changes: 1 addition & 1 deletion r/src/arrowExports.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions r/src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ void FinalizeS3() {
std::shared_ptr<arrow::KeyValueMetadata> strings_to_kvm(cpp11::strings metadata);

// [[gcs::export]]
std::shared_ptr<fs::GcsFileSystem> fs___GcsFileSystem__create(bool anonymous,
cpp11::list options) {
std::shared_ptr<fs::GcsFileSystem> fs___GcsFileSystem__Make(bool anonymous,
cpp11::list options) {
fs::GcsOptions gcs_opts;

// Handle auth (anonymous, credentials, default)
Expand Down Expand Up @@ -430,7 +430,7 @@ std::shared_ptr<fs::GcsFileSystem> fs___GcsFileSystem__create(bool anonymous,

auto io_context = MainRThread::GetInstance().CancellableIOContext();

return ::arrow::ValueOrStop(fs::GcsFileSystem::Make(gcs_opts, io_context));
return fs::GcsFileSystem::Make(gcs_opts, io_context);
}

// [[gcs::export]]
Expand Down

0 comments on commit 0ccb95d

Please sign in to comment.