-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Error reading parquet from s3 with s3fs >= 0.3.0 #27756
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
Comments
Sure. cc @martindurant for the (possibly unintentional) API change. |
So the Line 192 in 61362be
|
Indeed this is an API change. However, I am surprised that anyone is opening a file and then using the FS methods of the attribute of that file - you presumably have the FS available directly anyway at this point. Indeed, rather than test specifically for s3 URLs, I would strongly encourage pandas to use fsspec directly, so that then you can read from any of the implementations supported by fsspec. |
Perhaps there should be a function returning both the file and the filesystem, which can be used here instead of If that sounds like a reasonable direction I will work on a PR. |
I'm not sure what's best.
…On Mon, Aug 5, 2019 at 9:58 AM Chris Stadler ***@***.***> wrote:
Perhaps there should be a function returning both the file and the
filesystem, which can be used here instead of get_filepath_or_buffer.
That would avoid S3File.s3/S3File.fs.
If that sounds like a reasonable direction I will work on a PR.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27756?email_source=notifications&email_token=AAKAOIX27VNYLVWZZADDDFTQDA5Z3A5CNFSM4IJLDNJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3SCWKI#issuecomment-518269737>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIX6R6HBTG6K5TWDRYLQDA5Z3ANCNFSM4IJLDNJQ>
.
|
Ran into this issue today; just made a local, hacky in-vivo fix to the API break. Happy to help in any way to fix the issue properly. Cheers. |
For the sake of compatibility, I can make S3File.s3 -> S3File.fs alias, if that makes life easier. |
Is this compatible with the PEP 519 fspath protocol? We are dropping 3.6 soon so maybe worth looking towards that instead |
I have considered adding |
For the interested, the implementation is as simple as --- a/fsspec/spec.py
+++ b/fsspec/spec.py
@@ -1154,6 +1154,9 @@ class AbstractBufferedFile(io.IOBase):
def __str__(self):
return "<File-like object %s, %s>" % (type(self.fs).__name__, self.path)
+ def __fspath__(self):
+ return self.fs.protocol + "://" + self.path
+ |
@martindurant For compatibility with released pandas versions, that might be nice? (or at least for a while?) |
Done and released |
Thanks a lot! |
Code Sample, a copy-pastable example if possible
Raises
Problem description
In version 0.3.0 s3fs removed the
S3File.s3
attribute. It is replaced byS3File.fs
(which is inherited fromfsspec.AbstractBufferedFile.fs
.Should pandas check the s3fs version and call the right attribute based on that?
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.3.final.0
python-bits : 64
OS : Darwin
OS-release : 18.6.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 0.25.0
numpy : 1.17.0
pytz : 2019.1
dateutil : 2.8.0
pip : 19.2.1
setuptools : 41.0.1
Cython : None
pytest : 4.4.1
hypothesis : None
sphinx : 2.1.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : 2.8.3 (dt dec pq3 ext lo64)
jinja2 : 2.10.1
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : 0.3.1
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : 0.3.1
scipy : 1.3.0
sqlalchemy : 1.3.5
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: