Skip to content

CI: Bump s3fs #29573

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

Merged
merged 5 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/deps/travis-36-cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:
- python-snappy
- python=3.6.*
- pytz
- s3fs<0.3
- s3fs
- scikit-learn
- scipy
- sqlalchemy
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-36-locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies:
- python-dateutil
- python=3.6.*
- pytz
- s3fs=0.0.8
- s3fs=0.3.0
- scipy
- sqlalchemy=1.1.4
- xarray=0.10
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-36-slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- python-dateutil
- python=3.6.*
- pytz
- s3fs<0.3
- s3fs
- scipy
- sqlalchemy
- xlrd
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-37.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- pytest-xdist>=1.29.0
- pytest-mock
- hypothesis>=3.58.0
- s3fs<0.3
- s3fs
- pip
- pyreadstat
- pip:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ pymysql 0.7.11 MySQL engine for sqlalchemy
pyreadstat SPSS files (.sav) reading
pytables 3.4.2 HDF5 reading / writing
qtpy Clipboard I/O
s3fs 0.0.8 Amazon S3 access
s3fs 0.3.0 Amazon S3 access
xarray 0.8.2 pandas-like API for N-dimensional data
xclip Clipboard I/O on linux
xlrd 1.1.0 Excel reading
Expand Down
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Backwards incompatible API changes
Other API changes
^^^^^^^^^^^^^^^^^

- Bumpded the minimum supported version of ``s3fs`` from 0.0.8 to 0.3.0 (:issue:`28616`)
- :class:`pandas.core.groupby.GroupBy.transform` now raises on invalid operation names (:issue:`27489`)
- :meth:`pandas.api.types.infer_dtype` will now return "integer-na" for integer and ``np.nan`` mix (:issue:`27283`)
- :meth:`MultiIndex.from_arrays` will no longer infer names from arrays if ``names=None`` is explicitly provided (:issue:`27292`)
Expand Down
2 changes: 1 addition & 1 deletion pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"pandas_gbq": "0.8.0",
"pyarrow": "0.9.0",
"pytables": "3.4.2",
"s3fs": "0.0.8",
"s3fs": "0.3.0",
"scipy": "0.19.0",
"sqlalchemy": "1.1.4",
"tables": "3.4.2",
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/io/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def s3_resource(tips_file, jsonl_file):
A private bucket "cant_get_it" is also created. The boto3 s3 resource
is yielded by the fixture.
"""
pytest.importorskip("s3fs")
s3fs = pytest.importorskip("s3fs")
boto3 = pytest.importorskip("boto3")

with tm.ensure_safe_environment_variables():
Expand Down Expand Up @@ -77,6 +77,7 @@ def add_tips_files(bucket_name):

conn.create_bucket(Bucket="cant_get_it", ACL="private")
add_tips_files("cant_get_it")
s3fs.S3FileSystem.clear_instance_cache()
yield conn
finally:
s3.stop()
12 changes: 10 additions & 2 deletions pandas/tests/io/parser/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_s3_fails(self):
# Receive a permission error when trying to read a private bucket.
# It's irrelevant here that this isn't actually a table.
with pytest.raises(IOError):
read_csv("s3://cant_get_it/")
read_csv("s3://cant_get_it/file.csv")

def test_read_csv_handles_boto_s3_object(self, s3_resource, tips_file):
# see gh-16135
Expand All @@ -184,6 +184,8 @@ def test_read_csv_handles_boto_s3_object(self, s3_resource, tips_file):

def test_read_csv_chunked_download(self, s3_resource, caplog):
# 8 MB, S3FS usees 5MB chunks
import s3fs

df = DataFrame(np.random.randn(100000, 4), columns=list("abcd"))
buf = BytesIO()
str_buf = StringIO()
Expand All @@ -194,7 +196,13 @@ def test_read_csv_chunked_download(self, s3_resource, caplog):

s3_resource.Bucket("pandas-test").put_object(Key="large-file.csv", Body=buf)

with caplog.at_level(logging.DEBUG, logger="s3fs.core"):
# Possibly some state leaking in between tests.
# If we don't clear this cache, we saw `GetObject operation: Forbidden`.
# Presumably the s3fs instance is being cached, with the directory listing
# from *before* we add the large-file.csv in the pandas-test bucket.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is what the test failures are related to

s3fs.S3FileSystem.clear_instance_cache()

with caplog.at_level(logging.DEBUG, logger="s3fs"):
read_csv("s3://pandas-test/large-file.csv", nrows=5)
# log of fetch_range (start, stop)
assert (0, 5505024) in {x.args[-2:] for x in caplog.records}
Expand Down