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

Add exists as core method to fsspec #627

Closed

Conversation

evinism
Copy link
Contributor

@evinism evinism commented Apr 30, 2021

Several times, I've used fsspec and been disappointed that there hasn't been an "exists" function on the top level, in the exact same way that there's an "open" function on the top level.

This pull adds one!

Let me know if you don't think this is a good addition for whatever reason.

@martindurant
Copy link
Member

I appreciate the desire

Ref: #41

There are many methods that we wish would be top-level usable, and I think that rather than add them one--by-one, we would be better off making a general class for it. How would you imagine your function working in the presence of chained URLs, e.g., with file caching? Would you pass through kwargs every time (and how do you do that if you include multiple filesystems?)?

Note that open_file/open is special, since it returns OpenFile/OpenFiles objects (unlike the file-like object of the implementation open methods) that are guaranteed serialisation safe, and support extra features such as transparent compression and text mode.

@evinism
Copy link
Contributor Author

evinism commented Apr 30, 2021

Thank you for the feedback! If this difficulty continues to be an issue for us, I'll submit a proposal for such a universal file system.

@evinism evinism closed this Apr 30, 2021
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

Successfully merging this pull request may close these issues.

2 participants