question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python documentation does not properly reference encapsulation classes for L1 constructs

See original GitHub issue

It appears that the classes used to encapsulate properties for layer one constructs do not show up properly in the documentation. Digging into the generated code, JSII is creating the encapsulation classes as subclasses of the layer one constructs and using forward references for typing, which is causing the documentation to show something along the lines of Union[List[Union[ForwardRef, IResolveable]], IResolvable] rather than Union[List[Union[CfnNotificationRule.TargetProperty, IResolvable]], IResolvable].

Ex1 (for CfnNotificationRule.targets):

Python: https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_codestarnotifications/CfnNotificationRule.html

API: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codestarnotifications.CfnNotificationRule.html

Ex2 (for CfnDeliveryStream.elasticsearch_destination_configuration, CfnDeliveryStream.extended_s3_destination_configuration, CfnDeliveryStream.kinesis_stream_source_configuration, CfnDeliveryStream.redshift_destination_configuration, CfnDeliveryStream.s3_destination_configuration , CfnDeliveryStream.splunk_destination_configuration):

Python: https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_kinesisfirehose/CfnDeliveryStream.html

API: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kinesisfirehose.CfnDeliveryStream.html

Oddly enough, the *Props class for the layer one constructs has the correct name for the encapsulation class. However, it still does not link to the documentation for that class.

Ex (for CfnNotificationRuleProps): https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_codestarnotifications/CfnNotificationRuleProps.html

Further, the documentation for these subclasses doesn’t appear to be generated at all and I had to dig into the generated code to find information about them.


This is a 📕 documentation issue

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jul 7, 2020

I’ve recently added a section on using Cfn constructs to the Constructs topic in the Dev Guide.

https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_l1_using

I’d be interested in feedback (here, at the Guide repo, by clicking the feedback link on docs.aws.amazon.com…)

0reactions
github-actions[bot]commented, Oct 27, 2020

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Abstractions and escape hatches - AWS Documentation
If an L2 construct is missing a feature or you're trying to work around an issue, you can modify the L1 construct that's...
Read more >
Programming FAQ — Python 3.11.1 documentation
How do I share global variables across modules? What are the “best practices” for using import in a module? Why are default values...
Read more >
Structuring Your Project - The Hitchhiker's Guide to Python
In this section we take a closer look at Python's module and import systems as they are the central elements to enforcing structure...
Read more >
Encapsulation – Programming Fundamentals - Rebus Press
Encapsulation is one of the fundamentals of OOP (object-oriented programming). It refers to the bundling of data with the methods that operate on...
Read more >
Python Tutorial - Object-Oriented Programming (OOP)
1. Python OOP Basics. 1.1 OOP Basics. A class is a blueprint or template of entities ... Doc-strings are strongly recommended for proper...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found