Skip to content

Commit

Permalink
fix: operation module is properly aliased if necessary (#615)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
software-dov authored Sep 22, 2020
1 parent 358ca16 commit 8f92fd9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }},
Expand Down

0 comments on commit 8f92fd9

Please sign in to comment.