aai-institute / lakefs-spec

An fsspec implementation for the lakeFS project.
http://lakefs-spec.org/
Apache License 2.0
37 stars 4 forks source link

`fs.rm()` does not honor `recursive=False` (or `maxdepth`) #241

Closed nicholasjng closed 6 months ago

nicholasjng commented 6 months ago

This is a consequence of the fact that these options are not used in the object generator in Branch.delete_objects().

To fix, pass delimiter = "" if recursive else "/", just as we do for fs.ls(). For maxdepth, we can just count the number of slashes in the objects' path name (the rootdir is not included IIRC).