Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cpp/src/arrow/filesystem/gcsfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ Status GcsFileSystem::DeleteDirContents(const std::string& path) {
}

Status GcsFileSystem::DeleteRootDirContents() {
return Status::NotImplemented("The GCS FileSystem is not fully implemented");
return Status::NotImplemented(
std::string(__func__) +
" is not implemented as it is too dangerous to delete all the buckets");
}

Status GcsFileSystem::DeleteFile(const std::string& path) {
Expand Down
6 changes: 6 additions & 0 deletions cpp/src/arrow/filesystem/gcsfs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ TEST_F(GcsIntegrationTest, GetFileInfoObject) {
arrow::fs::AssertFileInfo(fs.get(), PreexistingObjectPath(), FileType::File);
}

TEST_F(GcsIntegrationTest, DeleteRootDirContents) {
auto fs = internal::MakeGcsFileSystemForTest(TestGcsOptions());
EXPECT_RAISES_WITH_MESSAGE_THAT(NotImplemented, HasSubstr("too dangerous"),
fs->DeleteRootDirContents());
}

TEST_F(GcsIntegrationTest, DeleteFileSuccess) {
auto fs = internal::MakeGcsFileSystemForTest(TestGcsOptions());
ASSERT_OK(fs->DeleteFile(PreexistingObjectPath()));
Expand Down