This repository was archived by the owner on Mar 23, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix RPC v2 CBOR timestamp parsing for float #13541
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 14 additions & 14 deletions
28
tests/aws/services/cloudwatch/test_cloudwatch.validation.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,9 @@ | |
| import xmltodict | ||
| from botocore.auth import SigV4Auth | ||
| from botocore.serialize import create_serializer | ||
| from cbor2._decoder import loads as cbor2_loads | ||
|
|
||
| # import the unpatched cbor2 on purpose to avoid being polluted by Kinesis-only patches | ||
| from cbor2 import loads as cbor2_loads | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. praise: Whoof, great catch! |
||
| from requests import Response | ||
|
|
||
| from localstack import constants | ||
|
|
@@ -45,9 +47,9 @@ def _build_headers(self, operation: str, query_mode: bool = False) -> dict: ... | |
| def _serialize_body(self, body: dict, operation: str) -> str | bytes: | ||
| # here we use the Botocore serializer directly, since it has some complex behavior, | ||
| # and we know CloudWatch supports it by default | ||
| query_serializer = create_serializer(self.protocol) | ||
| protocol_serializer = create_serializer(self.protocol) | ||
| operation_model = self.service_model.operation_model(operation) | ||
| request = query_serializer.serialize_to_request(body, operation_model) | ||
| request = protocol_serializer.serialize_to_request(body, operation_model) | ||
| return request["body"] | ||
|
|
||
| @property | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: Nice to see the patches introduced with #13103 are removed here since the official specs in
botocorealready contain these changes now! 💯 🧹