raulcd commented on issue #40052:
URL: https://github.com/apache/arrow/issues/40052#issuecomment-1954001709

   @pitrou @felipecrv trying to cherry-pick this fix is causing a bunch of 
conflicts on `azurefs.cc`. I can see there has been several new additions for 
16.0.0:
   https://github.com/apache/arrow/issues/38703
   https://github.com/apache/arrow/issues/39718
   https://github.com/apache/arrow/issues/38704
   
   This is the conflict:
   ```diff
   diff --cc cpp/src/arrow/filesystem/azurefs.cc
   index 730adab,1175059..0000000
   --- a/cpp/src/arrow/filesystem/azurefs.cc
   +++ b/cpp/src/arrow/filesystem/azurefs.cc
   @@@ -1649,20 -1856,29 +1650,27 @@@ class AzureFileSystem::Impl 
       /// \pre location.container is not empty.
       /// \pre location.path is not empty.
       Status DeleteDirOnFileSystem(const DataLake::DataLakeFileSystemClient& 
adlfs_client,
    -                               const AzureLocation& location, bool 
recursive,
    -                               bool require_dir_to_exist,
    -                               Azure::Nullable<std::string> lease_id = {}) 
{
    +                               const AzureLocation& location) {
         DCHECK(!location.container.empty());
         DCHECK(!location.path.empty());
   ++<<<<<<< HEAD
    +    auto directory_client = adlfs_client.GetDirectoryClient(location.path);
    +    // XXX: should "directory not found" be considered an error?
   ++=======
   +     auto directory_client = adlfs_client.GetDirectoryClient(
   +         std::string(internal::RemoveTrailingSlash(location.path)));
   +     DataLake::DeleteDirectoryOptions options;
   +     options.AccessConditions.LeaseId = std::move(lease_id);
   ++>>>>>>> 0dbbd43 (GH-40052: [C++][FS][Azure] Fix CreateDir and DeleteDir 
trailing slash issues on hierarchical namespace accounts (#40054))
         try {
    -      auto response = recursive ? directory_client.DeleteRecursive(options)
    -                                : directory_client.DeleteEmpty(options);
    -      // Only the "*IfExists" functions ever set Deleted to false.
    -      // All the others either succeed or throw an exception.
    -      DCHECK(response.Value.Deleted);
    -    } catch (const Storage::StorageException& exception) {
    -      if (exception.ErrorCode == "FilesystemNotFound" ||
    -          exception.ErrorCode == "PathNotFound") {
    -        if (require_dir_to_exist) {
    -          return PathNotFound(location);
    -        }
    +      auto response = directory_client.DeleteRecursive();
    +      if (response.Value.Deleted) {
             return Status::OK();
    +      } else {
    +        return StatusFromErrorResponse(directory_client.GetUrl(), 
*response.RawResponse,
    +                                       "Failed to delete a directory: " + 
location.path);
           }
    +    } catch (const Storage::StorageException& exception) {
           return ExceptionToStatus(exception, "Failed to delete a directory: 
", location.path,
                            ```
   
   I suppose this is correct an I should just pick the incoming change but just 
wanted to confirm.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to