Skip to content
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 interface declarations on returned objects #980

Merged
merged 4 commits into from
Nov 13, 2019

Conversation

RomainMuller
Copy link
Contributor

When the returned type had a known base type, the interfaces tagged on the object
reference tag. This addresses this problem.

Fixes #976


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Elad Ben-Israel and others added 2 commits November 12, 2019 22:54
When the returned type had a known base type, the interfaces tagged on the object
reference tag. This addresses this problem.
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we should add tests for .NET and Java just in case.

- implement the test for #976 in Java and .NET (PASSED)
- port `canLeverageIndirectInterfacePolymorphsm` to python (PASSED)
@eladb
Copy link
Contributor

eladb commented Nov 13, 2019

@RomainMuller I tool the liberty of implementing this test in .NET and Java, just in case, and also noticed that a related test is missing from python, so I added it (all passed).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@dxunix
Copy link

dxunix commented Nov 14, 2019

using cdk 1.16.3 (build 8c7f593)

'Resource' object has no attribute ... error still exists.
vpc = ec2.Vpc.from_lookup(self, "myvpc", vpc_id=VPC_ID)

@jvolkman
Copy link

@dxunix I had to update all of the Python dependencies in my virtual env before the issue was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python: return a subclass of a known class implementing an interface
5 participants