From 8f92fd9999286ef3f916119be78dbeb838a15550 Mon Sep 17 00:00:00 2001 From: Dov Shlachter Date: Tue, 22 Sep 2020 14:20:57 -0700 Subject: [PATCH 1/2] fix: operation module is properly aliased if necessary (#615) Some APIs define their own module named 'operation' that naively clashes with google.api_core.operation. Both modules are imported with a disambiguating alias, but the alias was not always referenced for the api_core submodule. This change fixes that issue. Fix for #610 --- .../%name/%version/%sub/services/%service/client.py.j2 | 2 +- .../%name_%version/%sub/services/%service/async_client.py.j2 | 2 +- .../%name_%version/%sub/services/%service/client.py.j2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 b/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 index 8de258d60b..2acc770d91 100644 --- a/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 +++ b/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2 @@ -369,7 +369,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta): {%- if method.lro %} # Wrap the response in an operation future. - response = operation.from_gapic( + response = {{ method.client_output.ident.module_alias or method.client_output.ident.module }}.from_gapic( response, self._transport.operations_client, {{ method.lro.response_type.ident }}, diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 index 8dfeb1a0bd..7368bf6943 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 @@ -240,7 +240,7 @@ class {{ service.async_client_name }}: {%- if method.lro %} # Wrap the response in an operation future. - response = operation_async.from_gapic( + response = {{ method.client_output_async.ident.module_alias or method.client_output_async.ident.module }}.from_gapic( response, self._client._transport.operations_client, {{ method.lro.response_type.ident }}, diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 index b598ac2526..b753848361 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 @@ -381,7 +381,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta): {%- if method.lro %} # Wrap the response in an operation future. - response = operation.from_gapic( + response = {{ method.client_output.ident.module_alias or method.client_output.ident.module }}.from_gapic( response, self._transport.operations_client, {{ method.lro.response_type.ident }}, From 17568913cc4f4d6411518b7e8fffc1489fece0c3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Sep 2020 14:26:11 -0700 Subject: [PATCH 2/2] chore: release 0.33.6 (#616) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c89b8a9b00..86729871c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [0.33.6](https://www.github.com/googleapis/gapic-generator-python/compare/v0.33.5...v0.33.6) (2020-09-22) + + +### Bug Fixes + +* operation module is properly aliased if necessary ([#615](https://www.github.com/googleapis/gapic-generator-python/issues/615)) ([8f92fd9](https://www.github.com/googleapis/gapic-generator-python/commit/8f92fd9999286ef3f916119be78dbeb838a15550)), closes [#610](https://www.github.com/googleapis/gapic-generator-python/issues/610) + ### [0.33.5](https://www.github.com/googleapis/gapic-generator-python/compare/v0.33.4...v0.33.5) (2020-09-22) diff --git a/setup.py b/setup.py index 6d4509a457..4ce942227c 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) -version = "0.33.5" +version = "0.33.6" with io.open(os.path.join(PACKAGE_ROOT, "README.rst")) as file_obj: README = file_obj.read()