Fixed serialization issue when cause is a string#284
Merged
Conversation
|
@lupengamzn when is the next planned release? |
srprash
reviewed
Apr 12, 2021
| for throwable in value['exceptions']: | ||
| throwables.append(throwable.to_dict()) | ||
| entity_dict[key]['exceptions'] = throwables | ||
| else: |
Contributor
There was a problem hiding this comment.
Can we check if the self.cause is a string before adding it to the entity_dict? This way if self.cause is neither a dict nor a string, we can just skip it and avoid adding something which may not be serializable.
Contributor
Author
Contributor
There was a problem hiding this comment.
I see. Then it should be fine. Thanks for confirming.
| actual_segment_one_dict = entity_to_dict(segment_one) | ||
| actual_segment_two_dict = entity_to_dict(segment_two) | ||
|
|
||
| assert expected_segment_one_dict == actual_segment_one_dict |
Contributor
There was a problem hiding this comment.
Not a big deal, but we should have two separate test cases since we are testing two different scenarios of exception chaining in the segments.
srprash
approved these changes
Apr 12, 2021
Hargrav3s
pushed a commit
to Gavant/aws-xray-sdk-python
that referenced
this pull request
Mar 22, 2022
Co-authored-by: Prashant Srivastava <50466688+srprash@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue #, if available:
#283
Description of changes:
Fixed serialization issue when
causeis astrBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.