I want to run the following code in Windows to get the first few lines from an s3 object:
import boto3
s3 = boto3.client('s3')
sql_stmt = """select * from s3object limit 5"""
req = s3.select_object_content(
Bucket=bucket,
Key=file,
ExpressionType='SQL',
Expression=sql_stmt,
InputSerialization = {'CSV': {'FileHeaderInfo': 'Use', 'FieldDelimiter': ','}},
OutputSerialization = {'CSV': {}})
It keeps telling me:
An error occurred (InvalidRequest) when calling the SelectObjectContent operation:
S3 Transfer Acceleration is not configured on this bucket
This may be related to my trying to test out transfer acceleration earlier this year (it didn't work). I tried to confirm and disable the transfer acceleration with aws cli:
aws configure set default.s3.use_accelerate_endpoint false
I can run this same code from an EMR cluster so the error is definitely local my Windows environment. How can I disable transfer acceleration??