Open
Description
Happy new year!
The following was a bit surprising to me. I was implementing directory caching of object listings, and saw that CommonPrefix
objects are included in the output of Reference.objects()
calls. Nice! That way, I can group everything below a prefix into a cache entry.
But sub-prefixes are not included: For example, in the sample data repository, if I listed all objects from root (i.e. .objects(prefix="/")
), the images/
folder would not appear as a common prefix. Is this intended? I basically now resort to computing the remaining other directories by taking the set of all parent prefixes of the resulting files.
Short diagram:
print(o for o in Branch().objects(prefix="/"))
------------------------------
CommonPrefix(path="/") <- root prefix whose listing I requested.
ObjectInfo(path="README.md", ...)
...
ObjectInfo(path="images/img01.jpg", ...) <-- I expected a sub-prefix like CommonPrefix(path="images") in front.
Thanks!