The Wayback Machine - https://web.archive.org/web/20220404160445/https://github.com/localstack/localstack/pull/5577
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

add flag to call_moto to exclude the ResponseMetadata #5577

Merged
merged 2 commits into from Feb 25, 2022

Conversation

thrau
Copy link
Member

@thrau thrau commented Feb 25, 2022

  • addresses what we are seeing in #5456
localstack  | 2022-02-25T17:20:57.061:ERROR:localstack.aws.protocol.serializer: Response object contains a member which is not specified: ResponseMetadata
localstack  | Traceback (most recent call last):
localstack  |   File "/opt/code/localstack/localstack/aws/protocol/serializer.py", line 903, in _serialize_type_structure
localstack  |     member_shape = members[member_key]
localstack  | KeyError: 'ResponseMetadata'
localstack  | {
localstack  |     "Version": 1
localstack  | }

since response contained the ResponseMetadata object as expected, from the botocore response parser, the subsequent ASF serialization process of call_moto calls would raise this error if you didn't explicitly remove the attribute. the regular way was to do th efollowing in ASF handlers which arguably is a bit silly.

def do_a_thing(context: RequestContext, ...):
	response = moto.call_moto(context)

	del response['ResponseMetadata']

	return response

@thrau thrau temporarily deployed to localstack-ext-tests Feb 25, 2022 Inactive
@thrau thrau requested a review from whummer Feb 25, 2022
@thrau thrau changed the title add flag to call_moto that exclude the ResponseMetadata add flag to call_moto that excludes the ResponseMetadata Feb 25, 2022
@thrau thrau changed the title add flag to call_moto that excludes the ResponseMetadata add flag to call_moto to exclude the ResponseMetadata Feb 25, 2022
Copy link
Member

@whummer whummer left a comment

Great, thanks for the quick fix @thrau ! 🚀

@@ -0,0 +1,4 @@
# format the codebase with black and isort
Copy link
Member

@whummer whummer Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding those!

@coveralls
Copy link

@coveralls coveralls commented Feb 25, 2022

Coverage Status

Coverage increased (+0.3%) to 87.614% when pulling f637778 on call-moto-exclude-metadata into 1333171 on master.

@github-actions
Copy link

@github-actions github-actions bot commented Feb 25, 2022

LocalStack integration with Pro

       3 files  ±0         3 suites  ±0   49m 55s ⏱️ -59s
   884 tests +1     848 ✔️ +1  36 💤 ±0  0 ±0 
1 086 runs  +1  1 029 ✔️ +1  57 💤 ±0  0 ±0 

Results for commit f637778. ± Comparison against base commit 1333171.

@thrau thrau merged commit 5379cbf into master Feb 25, 2022
14 checks passed
@thrau thrau deleted the call-moto-exclude-metadata branch Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants