File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ def _strip_schema(url):
16
16
return result .netloc + result .path
17
17
18
18
19
- def get_fs ():
20
- return s3fs .S3FileSystem (anon = False )
19
+ def get_fs (anon : bool = False ):
20
+ return s3fs .S3FileSystem (anon = anon )
21
21
22
22
23
23
def get_file_and_filesystem (
@@ -38,7 +38,7 @@ def get_file_and_filesystem(
38
38
# aren't valid for that bucket.
39
39
# A NoCredentialsError is raised if you don't have creds
40
40
# for that bucket.
41
- fs = get_fs ()
41
+ fs = get_fs (anon = True )
42
42
file = fs .open (_strip_schema (filepath_or_buffer ), mode )
43
43
return file , fs
44
44
Original file line number Diff line number Diff line change 2
2
3
3
import pytest
4
4
5
+ import pandas .util ._test_decorators as td
6
+
5
7
from pandas import read_csv
8
+ import pandas ._testing as tm
6
9
7
10
from pandas .io .common import is_s3_url
8
11
@@ -23,3 +26,10 @@ def test_streaming_s3_objects():
23
26
for el in data :
24
27
body = StreamingBody (BytesIO (el ), content_length = len (el ))
25
28
read_csv (body )
29
+
30
+
31
+ @tm .network
32
+ @td .skip_if_no ("s3fs" )
33
+ def test_read_without_creds_from_pub_bucket ():
34
+ result = read_csv ("s3://gdelt-open-data/events/1981.csv" , nrows = 3 )
35
+ assert len (result ) == 3
You can’t perform that action at this time.
0 commit comments