-
Notifications
You must be signed in to change notification settings - Fork 143
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
Fixed serialization issue when cause is a string #284
Conversation
@lupengamzn when is the next planned release? |
for throwable in value['exceptions']: | ||
throwables.append(throwable.to_dict()) | ||
entity_dict[key]['exceptions'] = throwables | ||
else: |
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.
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.
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.
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.
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 |
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.
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.
Co-authored-by: Prashant Srivastava <[email protected]>
Issue #, if available:
#283
Description of changes:
Fixed serialization issue when
cause
is astr
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.