-
Notifications
You must be signed in to change notification settings - Fork 242
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
fix(python): correctly handle nested structs-as-dict #973
Conversation
Added code to up-cast from `dict` to the relevant struct type in the generated python code whenever the value type is some unambiguous struct. Whenever a UNION of types is involved, the user must construct the struct type themselves, as the runtime would then have no way to choose which type should be used on it's own without additional information.
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.
You’ll need to figure out how to write a regression test for this.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
Missing test
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
* fix(python): correctly handle nested structs-as-dict Added code to up-cast from `dict` to the relevant struct type in the generated python code whenever the value type is some unambiguous struct. Whenever a UNION of types is involved, the user must construct the struct type themselves, as the runtime would then have no way to choose which type should be used on it's own without additional information. * add None explicit test
Added code to up-cast from
dict
to the relevant struct type in the generatedpython code whenever the value type is some unambiguous struct. Whenever
a UNION of types is involved, the user must construct the struct type themselves,
as the runtime would then have no way to choose which type should be used on
it's own without additional information.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.