-
Notifications
You must be signed in to change notification settings - Fork 69
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
Addition of policy
and options
to reserved names in #824 results in breaking changes to stable libraries
#835
Comments
Options cannot, policy may be. @parthea can chime in for context, I think he's working with the APIs that require these names. |
The issue I encountered was with keyword Prior to generator version 0.43.2 there was a conflict with
With the fix in version 0.43.2
You can see the change here: |
Given what @parthea shared, is it possible to back out the change? Or can we tweak the raw imports in the templates to use references that are less likely to conflict? from google import auth
credentials, _ = auth.default(scopes=self._scopes, quota_project_id=quota_project_id) import google.auth
credentials, _ = google.auth.default(scopes=self._scopes, quota_project_id=quota_project_id) |
@software-dov, PTAL |
I think this is breaking generation of the datacatalog library googleapis/python-datacatalog#143 (comment) |
Do we have a sense of how time critical this issue is, or a required timeline? |
@software-dov I'm currently blocking generator updates on the repos listed. So any features since that change (GAPIC metadata and self-signed JWT) will not land in those repos for the time being. I could technically add synth replaces to avoid the breaking change, but would rather not do so for 10+ repos since it is error prone. |
) Fixes #835. Breakdown by name that was originally added in #824 - `auth`: `from google import auth` -> `import google.auth` - `credentials`: `from google.auth import credentials` -> `from google.auth import credentials as ga_credentials` - `exceptions`: `from google.api_core import exceptions` -> `from google.api_core import exceptions as core_exceptions` - `future`: skipped, as it is only used in the [generated tests](https://github.com/googleapis/gapic-generator-python/search?q=%22import+future%22) and has a low chance of colliding - `options` `from google.iam.v1 import options_pb2 as options` -> `from google.iam.v1 import options_pb2` - `policy` `from google.iam.v1 import policy_pb2 as policy` -> `from google.iam.v1 import policy_pb2` - `math` skipped as it is only used in [generated tests](https://github.com/googleapis/gapic-generator-python/search?q=%22import+math%22) For `options` and `policy` there is a small change to `gapic/schema/metadata.py` to not alias `_pb2` types
These APIs have field renames resulting from this #824 which expanded the
RESERVED_NAMES
list. Some of them are GA, and even for beta APIs I'd prefer not to take changes that looks spurious from the user's perspective.googleapis/python-artifact-registry#12
googleapis/python-cloudbuild#81
googleapis/python-iot#87
googleapis/python-functions#45
googleapis/python-securitycenter#120
googleapis/python-bigquery-connection#57
googleapis/python-containeranalysis#112
googleapis/python-bigtable#280
googleapis/python-tasks#85
googleapis/python-policy-troubleshooter#8
googleapis/python-asset#171
googleapis/python-org-policy#32
googleapis/python-binary-authorization#18
googleapis/python-spanner#303
googleapis/python-secret-manager#100
googleapis/python-firestore#336
googleapis/python-billing#55
googleapis/python-datacatalog#143
policy
andoptions
are the two that show up in these APIs.From looking at the regen, it doesn't look like these need to be added to the reserved names list? f5e9f36 seems to result in the imports being renamed to not conflict. I see
from google.iam.v1 import policy_pb2 as giv_policy
(example) instead offrom google.iam.v1 import policy_pb2 as policy
.Can
policy
andoptions
be removed from the list? @software-dovThe text was updated successfully, but these errors were encountered: