[codegen/python] - Include python enum docstrings (#7374)

This commit is contained in:
Komal 2021-06-28 15:06:50 -05:00 committed by GitHub
parent c37cbc998b
commit e0902d2489
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View file

@ -11,10 +11,10 @@
### Bug Fixes
- [sdk/dotnet] - Fix swallowed nested exceptions with inline program so they correctly bubble to consumer
- [sdk/dotnet] - Fix swallowed nested exceptions with inline program, so they correctly bubble to the consumer.
[#7323](https://github.com/pulumi/pulumi/pull/7323)
- [sdk/go] - Specify known when creating outputs for construct.
- [sdk/go] - Specify known when creating outputs for `construct`.
[#7343](https://github.com/pulumi/pulumi/pull/7343)
- [cli] - Fix passphrase rotation.
@ -25,3 +25,6 @@
- [multilang/nodejs] - Fix a hang when an error is thrown within an apply in a remote component.
[#7365](https://github.com/pulumi/pulumi/pull/7365)
- [codegen/python] - Include enum docstrings for python.
[#7374](https://github.com/pulumi/pulumi/pull/7374)

View file

@ -27,8 +27,11 @@ class RubberTreeVariety(str, Enum):
types of rubber trees
"""
BURGUNDY = "Burgundy"
"""A burgundy rubber tree."""
RUBY = "Ruby"
"""A ruby rubber tree."""
TINEKE = "Tineke"
"""A tineke rubber tree."""
class TreeSize(str, Enum):

View file

@ -1479,6 +1479,9 @@ func (mod *modContext) genEnum(w io.Writer, enum *schema.EnumType) error {
} else {
fmt.Fprintf(w, "%v\n", e.Value)
}
if e.Comment != "" {
fmt.Fprintf(w, "%s\"\"\"%s\"\"\"\n", indent, e.Comment)
}
}
default:
return errors.Errorf("enums of type %s are not yet implemented for this language", enum.ElementType.String())