Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'MockRawResponse' object has no attribute 'content' error when using await bucket.copy #7070

Closed
grigory-bogush opened this issue Nov 27, 2023 · 1 comment
Labels

Comments

@grigory-bogush
Copy link

grigory-bogush commented Nov 27, 2023

When mocking s3 with mock_s3 copying files doesn't work with aioboto3.

moto: 4.20
aioboto3: 12.0.0
aiobotocore: 2.7.0
botocore: 1.31.17
boto3: 1.28.17
await bucket.copy({"Bucket": source_bucket, "Key": source_key}, target_key)
  File "/home/grigory-bogush/.cache/pypoetry/virtualenvs/magic-action-runner-wY7p_e2F-py3.10/lib/python3.10/site-packages/aioboto3/s3/inject.py", line 426, in copy
    await self.upload_fileobj(
  File "/home/grigory-bogush/.cache/pypoetry/virtualenvs/magic-action-runner-wY7p_e2F-py3.10/lib/python3.10/site-packages/aioboto3/s3/inject.py", line 373, in upload_fileobj
    raise exception
  File "/home/grigory-bogush/.cache/pypoetry/virtualenvs/magic-action-runner-wY7p_e2F-py3.10/lib/python3.10/site-packages/aioboto3/s3/inject.py", line 276, in file_reader
    data = await data_chunk
  File "/home/grigory-bogush/.cache/pypoetry/virtualenvs/magic-action-runner-wY7p_e2F-py3.10/lib/python3.10/site-packages/aiobotocore/response.py", line 56, in read
    chunk = await self.__wrapped__.content.read(
AttributeError: 'MockRawResponse' object has no attribute 'content'
@bblommers
Copy link
Collaborator

Moto only supports botocore/boto3 @grigory-bogush , not aiobotocore.

Relevant issue in their repository: aio-libs/aiobotocore#755

And some related issues in ours:
#2706
#3259
#6836

@bblommers bblommers closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
sushi30 added a commit to open-metadata/OpenMetadata that referenced this issue Sep 11, 2024
1. use minio instead of moto for mimicking s3 behavior.
2. removed moto dependency as it is not compatible with aiobotocore (getmoto/moto#7070 (comment))
pmbrull pushed a commit to open-metadata/OpenMetadata that referenced this issue Sep 12, 2024
* tests(datalake): use minio

1. use minio instead of moto for mimicking s3 behavior.
2. removed moto dependency as it is not compatible with aiobotocore (getmoto/moto#7070 (comment))

* - moved test_datalake_profiler_e2e.py to datalake/test_profiler
- use minio instead of moto

* fixed tests

* fixed tests

* removed default name for minio container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants