You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/07/07 11:39:25 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #7655: ARROW-9121: [C++] Forbid empty or root path in FileSystem::DeleteDirContents

pitrou commented on a change in pull request #7655:
URL: https://github.com/apache/arrow/pull/7655#discussion_r450799978



##########
File path: python/pyarrow/_fs.pyx
##########
@@ -484,10 +484,17 @@ cdef class FileSystem:
         ----------
         path : str
             The path of the directory to be deleted.
+        accept_root_dir : boolean, default False
+            Allow deleting the root directory's contents
+            (if path is empty or "/")
         """
         cdef c_string directory = _path_as_bytes(path)
-        with nogil:
-            check_status(self.fs.DeleteDirContents(directory))
+        if accept_root_dir and directory in (b"", b"/"):

Review comment:
       Sure.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org