-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
TST: Streaming of S3 files #22520
TST: Streaming of S3 files #22520
Conversation
CI will crash and burn as I didn't add |
I think the easiest thing to do is to ensure the test is skipped without botocore, and rely on |
ci/environment-dev.yaml
Outdated
@@ -9,6 +9,7 @@ dependencies: | |||
- flake8-comprehensions | |||
- hypothesis>=3.58.0 | |||
- moto | |||
- botocore>=1.10.47 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this can be removed.
pandas/tests/io/test_s3.py
Outdated
@@ -1,3 +1,7 @@ | |||
from six import BytesIO | |||
|
|||
from botocore.response import StreamingBody |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And remove this.
pandas/tests/io/test_s3.py
Outdated
|
||
|
||
def test_streaming_s3_objects(): | ||
data = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then here you can do botocore_response = pytest.importorskip('botocore.response', minversion='1.10.47')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this when the version pertains to the base module, not the imported class? I just tried it in a dummy file and all I got was Skipped: module 'botocore.response' has __version__ None, required is: '1.10.47'
. So should I do something like this?
import pytest
def my_test_fn():
pytest.importorskip('botocore', minversion='1.10.47')
from botocore.response import StreamingBody
# test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, your suggestion should work.
pandas/tests/io/test_s3.py
Outdated
@@ -1,3 +1,7 @@ | |||
from six import BytesIO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from pandas.compat import BytesIO
Codecov Report
@@ Coverage Diff @@
## master #22520 +/- ##
=========================================
Coverage ? 92.03%
=========================================
Files ? 169
Lines ? 50780
Branches ? 0
=========================================
Hits ? 46737
Misses ? 4043
Partials ? 0
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc comment ping on green.
pandas/tests/io/test_s3.py
Outdated
|
||
|
||
def test_streaming_s3_objects(): | ||
pytest.importorskip('botocore', minversion='1.10.47') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add the issue number here as a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, done
Codecov Report
@@ Coverage Diff @@
## master #22520 +/- ##
=========================================
Coverage ? 92.03%
=========================================
Files ? 169
Lines ? 50780
Branches ? 0
=========================================
Hits ? 46737
Misses ? 4043
Partials ? 0
Continue to review full report at Codecov.
|
thanks! |
Issue #17135 was resolved by an upstream change, this is just a unit test to avoid regressions.