data icon indicating copy to clipboard operation
data copied to clipboard

FSSpecFileLister slow warmup with many files

Open platers opened this issue 1 year ago • 3 comments

🚀 The feature

It would be great if FSSpecFileLister could iteratively list files instead of preloading them all.

Motivation, pitch

With a cloud provider, listing all the files in a directory is slow and expensive. In my GCS dir with 200k files FSSpecFileLister takes forever to return a single url.

It would be great if FSSpecFileLister could iteratively list files instead of preloading them all.

Alternatives

No response

Additional context

fsspec seems to support returning a generator via walk().

https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.walk

platers avatar Feb 12 '23 21:02 platers