Skip to content

Commit 2af34aa

Browse files
committed
file bugs
1 parent 06c267c commit 2af34aa

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

google/api_core/operations_v1/abstract_operations_async_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def __init__(
9898
"""
9999
super().__init__(
100100
credentials=credentials, # type: ignore
101+
# NOTE: If a transport is not provided, we force the client to use the async
102+
# REST transport, as it should.
101103
transport=transport or "rest_asyncio",
102104
client_options=client_options,
103105
client_info=client_info,

google/api_core/operations_v1/abstract_operations_base_client.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,32 +132,32 @@ def _get_default_mtls_endpoint(api_endpoint):
132132

133133
@classmethod
134134
def from_service_account_info(cls, info: dict, *args, **kwargs):
135-
"""Creates an instance of this client using the provided credentials
136-
info.
135+
"""
136+
This class method should be overridden by the subclasses.
137137
138138
Args:
139139
info (dict): The service account private key info.
140140
args: Additional arguments to pass to the constructor.
141141
kwargs: Additional arguments to pass to the constructor.
142142
143-
Returns:
144-
AbstractOperationsClient: The constructed client.
143+
Raises:
144+
NotImplementedError: If the method is called on the base class.
145145
"""
146146
raise NotImplementedError("`from_service_account_info` is not implemented.")
147147

148148
@classmethod
149149
def from_service_account_file(cls, filename: str, *args, **kwargs):
150-
"""Creates an instance of this client using the provided credentials
151-
file.
150+
"""
151+
This class method should be overridden by the subclasses.
152152
153153
Args:
154154
filename (str): The path to the service account private key json
155155
file.
156156
args: Additional arguments to pass to the constructor.
157157
kwargs: Additional arguments to pass to the constructor.
158158
159-
Returns:
160-
AbstractOperationsClient: The constructed client.
159+
Raises:
160+
NotImplementedError: If the method is called on the base class.
161161
"""
162162
raise NotImplementedError("`from_service_account_file` is not implemented.")
163163

@@ -359,14 +359,18 @@ def __init__(
359359
self._transport = transport
360360
else:
361361
Transport = type(self).get_transport_class(transport)
362+
# NOTE: The conditional logic below to initialize the transport can be removed
363+
# once we have feature parity with the sync transport.
362364
if "async" in str(Transport).lower():
363-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2136): Support the following parameters in async rest.
364365
unsupported_params = {
366+
# TODO(https://github.com/googleapis/python-api-core/issues/715): Add support for `credentials_file` to async REST transport.
365367
"google.api_core.client_options.ClientOptions.credentials_file": client_options.credentials_file,
368+
# TODO(https://github.com/googleapis/python-api-core/issues/716): Add support for `scopes` to async REST transport.
366369
"google.api_core.client_options.ClientOptions.scopes": client_options.scopes,
370+
# TODO(https://github.com/googleapis/python-api-core/issues/717): Add support for `quota_project_id` to async REST transport.
367371
"google.api_core.client_options.ClientOptions.quota_project_id": client_options.quota_project_id,
372+
# TODO(https://github.com/googleapis/python-api-core/issues/718): Add support for `client_cert_source` to async REST transport.
368373
"google.api_core.client_options.ClientOptions.client_cert_source": client_options.client_cert_source,
369-
"google.api_core.client_options.ClientOptions.api_audience": client_options.api_audience,
370374
}
371375
provided_unsupported_params = [
372376
name

google/api_core/operations_v1/transports/rest_asyncio.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ def __init__(
7777
url_scheme: str = "https",
7878
http_options: Optional[Dict] = None,
7979
path_prefix: str = "v1",
80+
# TODO(https://github.com/googleapis/python-api-core/issues/715): Add support for `credentials_file` to async REST transport.
81+
# TODO(https://github.com/googleapis/python-api-core/issues/716): Add support for `scopes` to async REST transport.
82+
# TODO(https://github.com/googleapis/python-api-core/issues/717): Add support for `quota_project_id` to async REST transport.
83+
# TODO(https://github.com/googleapis/python-api-core/issues/718): Add support for `client_cert_source` to async REST transport.
8084
) -> None:
8185
"""Instantiate the transport.
8286

0 commit comments

Comments
 (0)