Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API miss on s3fs.walk method #807

Open
graydenshand opened this issue Oct 11, 2023 · 1 comment
Open

API miss on s3fs.walk method #807

graydenshand opened this issue Oct 11, 2023 · 1 comment

Comments

@graydenshand
Copy link

graydenshand commented Oct 11, 2023

The s3fs API docs document the walk method as taking an on_error parameter: https://s3fs.readthedocs.io/en/latest/api.html#s3fs.core.S3FileSystem.walk.

This is in line with the general fsspec API https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.spec.AbstractFileSystem.walk

However, it seems that the source for walk doesn't named the on_error parameter: https://github.com/fsspec/s3fs/blob/main/s3fs/core.py#L1972-L1976

The effect is that calling s3fs.walk with on_error specified passes that parameter through to _ls() which does not accept the parameter and raises an error.

Reproducible example

>>> from s3fs import S3FileSystem
>>> fs = S3FileSystem()
>>> [entry for entry in fs.walk('s3://my-bucket', on_error='omit')]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <listcomp>
  File "/Users/gshand/code/py-beta-common/.venv/lib/python3.8/site-packages/fsspec/spec.py", line 393, in walk
    listing = self.ls(path, detail=True, **kwargs)
  File "/Users/gshand/code/py-beta-common/.venv/lib/python3.8/site-packages/fsspec/asyn.py", line 113, in wrapper
    return sync(self.loop, func, *args, **kwargs)
  File "/Users/gshand/code/py-beta-common/.venv/lib/python3.8/site-packages/fsspec/asyn.py", line 80, in sync
    coro = func(*args, **kwargs)
TypeError: _ls() got an unexpected keyword argument 'on_error'
@martindurant
Copy link
Member

Yes, I agree that on_error should be available for s3fs's bulk operations; perhaps someone has the time to add it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants