You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: remove auth, policy, and options from the reserved names list (#851)
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
Copy file name to clipboardExpand all lines: packages/gapic-generator/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/client.py.j2
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,10 @@ from typing import Callable, Dict, Optional, {% if service.any_server_streaming
10
10
import pkg_resources
11
11
12
12
from google.api_core import client_options as client_options_lib # type: ignore
13
-
from google.api_core import exceptions # type: ignore
13
+
from google.api_core import exceptions as core_exceptions # type: ignore
14
14
from google.api_core import gapic_v1 # type: ignore
15
15
from google.api_core import retry as retries # type: ignore
16
-
from google.auth import credentials # type: ignore
16
+
from google.auth import credentials as ga_credentials # type: ignore
17
17
from google.auth.transport import mtls # type: ignore
18
18
from google.auth.transport.grpc import SslCredentials # type: ignore
19
19
from google.auth.exceptions import MutualTLSChannelError # type: ignore
@@ -174,7 +174,7 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
Copy file name to clipboardExpand all lines: packages/gapic-generator/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/base.py.j2
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@ import abc
6
6
import typing
7
7
import pkg_resources
8
8
9
-
from google import auth
9
+
import google.auth # type: ignore
10
10
from google.api_core import gapic_v1 # type: ignore
11
11
from google.api_core import retry as retries # type: ignore
12
12
{%ifservice.has_lro%}
13
13
from google.api_core import operations_v1 # type: ignore
14
14
{%endif%}
15
-
from google.auth import credentials # type: ignore
15
+
from google.auth import credentials as ga_credentials # type: ignore
16
16
17
17
{%filtersort_lines%}
18
18
{%formethodinservice.methods.values() %}
@@ -43,7 +43,7 @@ class {{ service.name }}Transport(metaclass=abc.ABCMeta):
Copy file name to clipboardExpand all lines: packages/gapic-generator/gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/grpc.py.j2
0 commit comments