From ed29906bf295a3576bec0ed41bb4b83fc2358bf7 Mon Sep 17 00:00:00 2001 From: Thomas Newton Date: Sun, 19 Nov 2023 01:42:02 +0000 Subject: [PATCH] Add simple sanity checks on the location --- cpp/src/arrow/filesystem/azurefs.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/filesystem/azurefs.cc b/cpp/src/arrow/filesystem/azurefs.cc index e6113a6b62261..70a2f6697cfde 100644 --- a/cpp/src/arrow/filesystem/azurefs.cc +++ b/cpp/src/arrow/filesystem/azurefs.cc @@ -554,7 +554,6 @@ class ObjectAppendStream final : public io::OutputStream { } else { try { auto properties = block_blob_client_->GetProperties(); - // TODO: Consider adding a check for whether its a directory. content_length_ = properties.Value.BlobSize; pos_ = content_length_; } catch (const Azure::Storage::StorageException& exception) { @@ -947,7 +946,8 @@ class AzureFileSystem::Impl { const AzureLocation& location, const std::shared_ptr& metadata, const bool truncate, AzureFileSystem* fs) { - // TODO: Ensure cheap checks which don't require a call to Azure are done. + RETURN_NOT_OK(ValidateFileLocation(location)); + ARROW_RETURN_NOT_OK(internal::AssertNoTrailingSlash(location.path)); if (location.empty() || location.path.empty()) { return ::arrow::fs::internal::PathNotFound(location.path); }