Access data in Blaze S3 private JSON files from Blaze

I am trying to access string delimited JSON data in S3. From my understanding of the docs, I could do something like

print data(S3(Chunks(JSONLines))('s3://KEY:SECRET@bucket/dir/part-*.json').peek()

which throws

BotoClientError: BotoClientError: Bucket names cannot contain upper-case characters when using either the sub-domain or virtual hosting calling format.

I tried options leading to various errors.

I can get the following for working with local files:

print data(chunks(JSONLines)(map(JSONLines, glob("/home/me/data/*")))).peek()

I'm not sure why you need it (map(JSONLines, glob(.

I really don't understand how to work with type-modofiers

+4
source share
1 answer

The comment section in example 6 from this page http://www.programcreek.com/python/example/51587/boto.exception.BotoClientError states that:

bucket .      islower().      , , .

, , check_lowercase_bucketname(n) :

>>> check_lowercase_bucketname("Aaaa")
Traceback (most recent call last):
...
BotoClientError: S3Error: Bucket names cannot contain upper-case
characters when using either the sub-domain or virtual hosting calling
format.

>>> check_lowercase_bucketname("1234-5678-9123")
True
>>> check_lowercase_bucketname("abcdefg1234")
True

, , 's3://KEY:SECRET@bucket/dir/part-*.json' , KEY, SECRET UpperCase

+1

Source: https://habr.com/ru/post/1671484/


All Articles