From f5abaee67effbd74a7b4e2a5e4f867afae46fa17 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Wed, 17 Jun 2026 15:25:03 -0400 Subject: [PATCH 1/2] Implement topdown doe async walk() --- fsspec/asyn.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/fsspec/asyn.py b/fsspec/asyn.py index f6a58fc2a..32ad3d35d 100644 --- a/fsspec/asyn.py +++ b/fsspec/asyn.py @@ -745,7 +745,7 @@ async def _info(self, path, **kwargs): async def _ls(self, path, detail=True, **kwargs): raise NotImplementedError - async def _walk(self, path, maxdepth=None, on_error="omit", **kwargs): + async def _walk(self, path, maxdepth=None, topdown=True, on_error="omit", **kwargs): if maxdepth is not None and maxdepth < 1: raise ValueError("maxdepth must be at least 1") @@ -783,22 +783,35 @@ async def _walk(self, path, maxdepth=None, on_error="omit", **kwargs): else: files[name] = info - if detail: + if not detail: + dirs = list(dirs) + files = list(files) + + if topdown: + # Yield before recursion if walking top down yield path, dirs, files - else: - yield path, list(dirs), list(files) if maxdepth is not None: maxdepth -= 1 if maxdepth < 1: + if not topdown: + yield path, dirs, files return for d in dirs: async for _ in self._walk( - full_dirs[d], maxdepth=maxdepth, detail=detail, **kwargs + full_dirs[d], + maxdepth=maxdepth, + detail=detail, + topdown=topdown, + **kwargs, ): yield _ + if not topdown: + # Yield after recursion if walking bottom up + yield path, dirs, files + async def _glob(self, path, maxdepth=None, **kwargs): if maxdepth is not None and maxdepth < 1: raise ValueError("maxdepth must be at least 1") From e1c1d82872227fb704e6a76b5659259f6da68150 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Wed, 17 Jun 2026 15:34:13 -0400 Subject: [PATCH 2/2] pytest10 --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a3998023a..c00ef57f3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -155,5 +155,5 @@ jobs: run: | cd ${{ matrix.FRIEND }} pip install -e . --no-deps - pytest -v -W ignore::pytest.PytestRemovedIn9Warning --ignore=gcsfs/tests/perf + pytest -v -W ignore::pytest.PytestRemovedIn10Warning --ignore=gcsfs/tests/perf cd ..