An error occurred (MethodNotAllowed) when calling the SelectObjectContent operation: The specified method is not allowed against this resource.
Getting the above error when running the below command:
file_s3_key = ‘csv/ratings_ml_training_dataset.csv’
kwargs = {‘ExpressionType’: ‘SQL’,
‘Expression’: “”“SELECT * FROM s3object AS s WHERE s."productline" = ‘Trains’ LIMIT 20"”",
‘InputSerialization’: {‘CSV’: {“FileHeaderInfo”: “Use”}, ‘CompressionType’: ‘NONE’},
‘OutputSerialization’: {‘CSV’: {}},
}
response = s3_select_object_content(bucket_name=BUCKET_NAME, object_key=file_s3_key, **kwargs)