Skip to content

AbstractFileSystem.rm() doc ambiguous - files, directories, both? #1914

@keen85

Description

@keen85

Hi,
I noticed that AbstractFileSystem.rm() docs is a little bit imprecise here:
Image
The main description indicates that the method is meant to use files, but presence and description of recurse and maxdepth imply that it should also work for directories.

If it should works for both directories and files, this should reflect in the main description as well as description of path parameter.

filesystem_spec/fsspec/spec.py

Lines 1232 to 1246 in f84b99f

def rm(self, path, recursive=False, maxdepth=None):
"""Delete files.
Parameters
----------
path: str or list of str
File(s) to delete.
recursive: bool
If file(s) are directories, recursively delete contents and then
also remove the directory
maxdepth: int or None
Depth to pass to walk for finding files to delete, if recursive.
If None, there will be no limit and infinite recursion may be
possible.
"""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions