felipecrv commented on code in PR #40075:
URL: https://github.com/apache/arrow/pull/40075#discussion_r1491394837


##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -2544,7 +2635,28 @@ Status AzureFileSystem::DeleteRootDirContents() {
 
 Status AzureFileSystem::DeleteFile(const std::string& path) {
   ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path));
-  return impl_->DeleteFile(location);
+  if (location.container.empty()) {
+    return Status::Invalid("DeleteFile requires a non-empty path.");
+  }
+  if (internal::HasTrailingSlash(location.path) || location.path.empty()) {
+    // Container paths (locations w/o path) or paths ending with a slash are 
not file
+    // paths.
+    return NotAFile(location);
+  }

Review Comment:
   It's not the same logic I'm implementing here and it obscures the 
pre-conditions I'm guaranteeing before delegating to 
`DeleteFileOnFileSystem/DeleteFileOnContainer`.
   



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