-
Notifications
You must be signed in to change notification settings - Fork 246
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
Struct multi-inheritance generates wrong Python code #2653
Labels
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
language/python
Related to Python bindings
module/pacmak
Issues affecting the `jsii-pacmak` module
p1
Comments
skinny85
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Mar 4, 2021
RomainMuller
added a commit
that referenced
this issue
Mar 5, 2021
When a struct field is inherited from more than one parent (this could be twice from the same type - in the case of a diamond shape; or from two distinct parents that declare the same field), the lifted keyword arguments in python would be duplicated for this field. This is because the method that performs the keyword argument lifting did not perform name-based de-duplication, and operates directly on the "raw" assembly (whereby it must traverse the inheritance tree itself, as opposed to the Go generator which uses `jsii-reflect` and has the field collection done by that library). Added the necessary de-duplication logic and confirmed the produced code now looks correct using the exact same test harness as I had introduced in #2650. Fixes #2653
RomainMuller
added a commit
that referenced
this issue
Mar 5, 2021
When a struct field is inherited from more than one parent (this could be twice from the same type - in the case of a diamond shape; or from two distinct parents that declare the same field), the lifted keyword arguments in python would be duplicated for this field. This is because the method that performs the keyword argument lifting did not perform name-based de-duplication, and operates directly on the "raw" assembly (whereby it must traverse the inheritance tree itself, as opposed to the Go generator which uses `jsii-reflect` and has the field collection done by that library). Added the necessary de-duplication logic and confirmed the produced code now looks correct using the exact same test harness as I had introduced in #2650. Fixes #2653
RomainMuller
added
effort/small
Small work item – less than a day of effort
language/python
Related to Python bindings
module/pacmak
Issues affecting the `jsii-pacmak` module
p1
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Mar 5, 2021
RomainMuller
added a commit
that referenced
this issue
Mar 18, 2021
When a struct field is inherited from more than one parent (this could be twice from the same type - in the case of a diamond shape; or from two distinct parents that declare the same field), the lifted keyword arguments in python would be duplicated for this field. This is because the method that performs the keyword argument lifting did not perform name-based de-duplication, and operates directly on the "raw" assembly (whereby it must traverse the inheritance tree itself, as opposed to the Go generator which uses `jsii-reflect` and has the field collection done by that library). Fixes #2653
|
skinny85
added a commit
to skinny85/aws-cdk
that referenced
this issue
Mar 25, 2021
This is a re-submit of the PR aws#13356, which had to be reverted because of JSII issue aws/jsii#2653. Since that issue has been fixed in JSII version `1.26.0`, which is what we currently use, re-introduce the changes from that PR.
mergify bot
pushed a commit
to aws/aws-cdk
that referenced
this issue
Mar 29, 2021
This is a re-submit of the PR #13356, which had to be reverted because of JSII issue aws/jsii#2653. Since that issue has been fixed in JSII version `1.26.0`, which is what we currently use, re-introduce the changes from that PR. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd
pushed a commit
to hollanddd/aws-cdk
that referenced
this issue
Mar 31, 2021
This is a re-submit of the PR aws#13356, which had to be reverted because of JSII issue aws/jsii#2653. Since that issue has been fixed in JSII version `1.26.0`, which is what we currently use, re-introduce the changes from that PR. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd
pushed a commit
to hollanddd/aws-cdk
that referenced
this issue
Aug 26, 2021
This is a re-submit of the PR aws#13356, which had to be reverted because of JSII issue aws/jsii#2653. Since that issue has been fixed in JSII version `1.26.0`, which is what we currently use, re-introduce the changes from that PR. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
language/python
Related to Python bindings
module/pacmak
Issues affecting the `jsii-pacmak` module
p1
🐛 Bug Report
Affected Languages
TypeScript
orJavascript
Python
Java
C#
,F#
, ...)General Information
1.23.0
What is the problem?
After merging aws/aws-cdk#13356 in the CDK repo, JSII generates the following code for the
forAsset
static method in the@aws-cdk/aws-lambda
module:This is clearly wrong - the
exclude
andignore_mode
keyword args are duplicated.I suspect that's because the argument to
fromAsset()
,AssetOptions
from the@aws-cdk/aws-s3-assets
module, is currently defined as:Where both
assets.CopyOptions
andcdk.FileCopyOptions
define the propertiesexclude
andignoreMode
(of the same types,string[]
andcdk.IgnoreMode
, respectively).Verbose Log
The text was updated successfully, but these errors were encountered: