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:
[email protected]