I created a mock s3 bucket with moto. I put an object into it. I am trying to read with pandas read_csv.
S3_BUCKET_NAME = 'mock_bucket'
def s3_bucket():
mocks3 = mock_s3()
mocks3.start()
os.environ["AWS_DEFAULT_REGION"] = "us-east-1"
s3 = boto3.resource('s3')
s3.create_bucket(Bucket=S3_BUCKET_NAME)
return s3
s3 = s3_bucket()
bucket = s3.Bucket(S3_BUCKET_NAME)
bucket.put_object(Key='/2022/12/14/6/25/t_ext_gop/t.csv', Body='test')
a = pd.read_csv('s3://amx-mock-bigdata-stemtime/2022/12/14/6/25/t_ext_gop/t.csv')
I get the following error:
AttributeError: 'MockRawResponse' object has no attribute 'raw_headers'
How do I resolve this?