-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
TST: Streaming of S3 files #22520
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
Changes from 4 commits
901837f
0b74701
86cc36b
16d92aa
14634b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import pytest | ||
|
||
from pandas import read_csv | ||
from pandas.compat import BytesIO | ||
from pandas.io.common import is_s3_url | ||
|
||
|
||
|
@@ -6,3 +10,16 @@ class TestS3URL(object): | |
def test_is_s3_url(self): | ||
assert is_s3_url("s3://pandas/somethingelse.com") | ||
assert not is_s3_url("s4://pandas/somethingelse.com") | ||
|
||
|
||
def test_streaming_s3_objects(): | ||
pytest.importorskip('botocore', minversion='1.10.47') | ||
from botocore.response import StreamingBody | ||
|
||
data = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then here you can do There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, your suggestion should work. |
||
b'foo,bar,baz\n1,2,3\n4,5,6\n', | ||
b'just,the,header\n', | ||
] | ||
for el in data: | ||
body = StreamingBody(BytesIO(el), content_length=len(el)) | ||
read_csv(body) |
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