kou commented on code in PR #41068:
URL: https://github.com/apache/arrow/pull/41068#discussion_r1558296508


##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -2168,13 +2203,6 @@ class AzureFileSystem::Impl {
       // 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);
-        }
-        return Status::OK();
-      }

Review Comment:
   OK. I'll revert this for now.
   You can introduce better approach later if you can find it.
   
   FYI: We want to report a `NotADir()` for file location. But 
`DeleteRecursive()`/`DeleteEmpty()` can delete both of file and directory. See 
also: 
https://learn.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/delete?view=rest-storageservices-datalakestoragegen2-2019-12-12
   
   > Delete the file or directory.
   
   
https://github.com/apache/arrow/blob/cd607d00b9e3c5f2ac2a2e373ba7571fd75fc725/cpp/src/arrow/filesystem/test_util.cc#L274-L276
 is a test for this case.



-- 
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