From 7fc8b608d33558fbe1f9980e6ccc8a3db1cfb721 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Fri, 15 Mar 2024 16:21:27 -0400 Subject: [PATCH] pass through glob kwargs (#844) --- s3fs/core.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/s3fs/core.py b/s3fs/core.py index d080ae7f..21d06dba 100644 --- a/s3fs/core.py +++ b/s3fs/core.py @@ -798,7 +798,9 @@ async def _glob(self, path, **kwargs): raise ValueError("Cannot traverse all of S3") return await super()._glob(path, **kwargs) - async def _find(self, path, maxdepth=None, withdirs=None, detail=False, prefix=""): + async def _find( + self, path, maxdepth=None, withdirs=None, detail=False, prefix="", **kwargs + ): """List all files below path. Like posix ``find`` command without conditions @@ -825,7 +827,11 @@ async def _find(self, path, maxdepth=None, withdirs=None, detail=False, prefix=" ) if maxdepth: return await super()._find( - bucket + "/" + key, maxdepth=maxdepth, withdirs=withdirs, detail=detail + bucket + "/" + key, + maxdepth=maxdepth, + withdirs=withdirs, + detail=detail, + **kwargs, ) # TODO: implement find from dircache, if all listings are present # if refresh is False: @@ -836,7 +842,7 @@ async def _find(self, path, maxdepth=None, withdirs=None, detail=False, prefix=" # elif len(out) == 0: # return super().find(path) # # else: we refresh anyway, having at least two missing trees - out = await self._lsdir(path, delimiter="", prefix=prefix) + out = await self._lsdir(path, delimiter="", prefix=prefix, **kwargs) if not out and key: try: out = [await self._info(path)]