-
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
fix: add certain raw imports to RESERVED_NAMES #824
fix: add certain raw imports to RESERVED_NAMES #824
Conversation
The current example is 'auth', which is imported directly by both transports and unit tests. This name conflicts with any calculated dependency import whose name happens to be 'auth'. Fix involves adding 'auth' and other direct, raw imports in templates to RESERVED_NAMES.
Codecov Report
@@ Coverage Diff @@
## master #824 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 27 +1
Lines 1608 1653 +45
Branches 328 337 +9
=========================================
+ Hits 1608 1653 +45
Continue to review full report at Codecov.
|
🤖 I have created a release \*beep\* \*boop\* --- ### [0.43.2](https://www.github.com/googleapis/gapic-generator-python/compare/v0.43.1...v0.43.2) (2021-03-24) ### Bug Fixes * add certain raw imports to RESERVED_NAMES ([#824](https://www.github.com/googleapis/gapic-generator-python/issues/824)) ([04bd8aa](https://www.github.com/googleapis/gapic-generator-python/commit/04bd8aaf0fc2c2c0615105cab39dc33266b66775)) * Update module alias to resolve naming conflict ([#820](https://www.github.com/googleapis/gapic-generator-python/issues/820)) ([f5e9f36](https://www.github.com/googleapis/gapic-generator-python/commit/f5e9f367ec6a72b4272f559a93f6fbb3d7e54b8b)), closes [#819](https://www.github.com/googleapis/gapic-generator-python/issues/819) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
# the raw text is just there in the template. | ||
# More can be added as collisions are discovered. | ||
# See issue #819 for additional info. | ||
{"auth", "credentials", "exceptions", "future", "options", "policy", "math"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
policy
was a field name in the Dataproc API so the addition of policy
to RESERVED_NAMES
resulted in a breaking change. googleapis/python-dataproc#158 Patching over with a synth replace for now.
This reverts commit 04bd8aa.
) 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
The current example is 'auth', which is imported directly by both
transports and unit tests. This name conflicts with any calculated
dependency import whose name happens to be 'auth'.
Fix involves adding 'auth' and other direct, raw imports in templates
to RESERVED_NAMES.