-
Notifications
You must be signed in to change notification settings - Fork 360
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
AbstractBufferedFile.__fspath__ breaks dask's PyArrow.orc test #104
Comments
Drat, that is annoying. fspath was specifically asked for, and it makes a lot of sense in the context of fsspec: it gives back the URL with which you can access this file. pyarrow should really not be using it to determine whether the file is local or not (the behaviour of fspath is not defined for non local files) - they should use |
Hmm does |
It's not quite clear to me, but should we interpret the the filesystem in "Return the file system path representation of the object." from https://docs.python.org/3/library/os.html#os.PathLike.__fspath__ as "the local filesystem"? I'm not sure what else it could be understood as. |
Yeah, so it's less that clear. If only people hadn't started using |
Based on my (possibly incorrect) reading of the PEP, You say you have a |
The standard python file object has this. Actually, all IOBase derivatives have this (including fsspec ones like s3fs files), and it returns
As opposed to something ephemeral like a socket? I don't know, but it would be good to find out if pyarrow would use a file descriptor or not. |
I think the fact that In [11]: import os
In [12]: f = io.BytesIO(b'')
In [13]: os.fspath(f)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-13-4431b4b0ce22> in <module>
----> 1 os.fspath(f)
TypeError: expected str, bytes or os.PathLike object, not _io.BytesIO |
OK, OK: I'll remove it again |
With fsspec master, the following dask test fails
The pyarrow error message isn't really helpful. I've traced it down to AbstractBufferedFile.fspath. Removing that, the test passes.
Does fspath make sense on this object? Is it actually present on the filesystem, or just in memory?
xref dask/dask#5267
The text was updated successfully, but these errors were encountered: