-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Labels
priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
See the link to the generated code below for google/cloud/aiplatform/v1beta1 where the import statement for AcceleratorType is missing in google/cloud/aiplatform_v1beta1/types/__init__.py.
See the definition for AcceleratorType in the proto here:
https://github.com/googleapis/googleapis/blob/2fd7625cf9808234503fd5addc6e2bda8fe5c114/google/cloud/aiplatform/v1beta1/accelerator_type.proto#L28
The init file should have
from .accelerator_type import (
AcceleratorType,
)
The issue is that enums which are not part of messages are not added to __init__.py because of the proto.messages conditional check
gapic-generator-python/gapic/templates/%namespace/%name_%version/%sub/types/__init__.py.j2
Lines 5 to 14 in 90ba3f7
| {% for _, proto in api.protos|dictsort if proto.file_to_generate and proto.messages %} | |
| from .{{proto.module_name }} import ( | |
| {% for _, message in proto.messages|dictsort %} | |
| {{message.name }}, | |
| {% endfor %} | |
| {% for _, enum in proto.enums|dictsort %} | |
| {{ enum.name }}, | |
| {% endfor %} | |
| ) | |
| {% endfor %} |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.