Repository navigation
Honor depth limits and include directories in recursive find - #411
shcheklein wants to merge 18 commits into
Conversation
shcheklein
left a comment
There was a problem hiding this comment.
AI-generated review of 31de6118ae3e7d21aeb05d7e3a83bdadbfdf1720.
Good fix for maxdepth, withdirs, glob, and expand_path (including fsspec>=2021.07.0 maxdepth=0 and positional find(path, True) compatibility). Inline comments focus on simplifying find() (it doubled from ~48 to ~99 lines mainly due to duplicated self.info(path) fallbacks for untyped mount IDs), avoiding extra info() calls on directories with only subdirectories, and a key-vs-entry["name"] trailing-slash mismatch when detail=True, withdirs=True.
shcheklein
left a comment
There was a problem hiding this comment.
AI-generated re-review of 1dc810a85e2268d42dad294c541740083ae99102 (from scratch).
Big improvement—the duplicated self.info() fallback is gone, key == entry["name"] is now consistent via _directory_entry, known_dir = True in the loop avoids extra stat calls on subdirs-only mounts, and the unit + live tests are thorough.
No standalone bugs found; two small cross-PR alignment notes with #409 inline.
|
I tried The implementation keeps batching, uses #408’s resolver and builds paths from the parent IDs Drive returned. Both detailed and names-only results are sorted. Direct |
|
Raised the fsspec extra to 2024.2.0 and removed the legacy glob and path-expansion implementations. At 2023.1.0, a depth-one recursive expansion of DVC 3.67.1, dvc-objects 5.3.1 and dvc-data 3.18.3 already require fsspec 2024.2.0 or later. The DVC wrapper calls |
Fixes #325. This PR builds on #409 and #408.
find()honorsmaxdepthandwithdirs, sorts both output formats, and warns callers using the deprecated positional booleandetail. Cached folder IDs allow warm traversal across multiple levels in one Drive request. Current parent links determine the returned paths.The filesystem extra requires fsspec 2024.2.0 or newer. The Ubuntu Python 3.11 job tests that minimum. Bounded glob expansion delegates to fsspec. The tests cover depth 1 through 3, glob expansion, sorting, file and directory mounts, and exact cold and warm request counts. The wide fixture takes seven requests cold and six warm.