Skip to content

Commit

Permalink
file bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ohmayr committed Oct 2, 2024
1 parent 06c267c commit 2af34aa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def __init__(
"""
super().__init__(
credentials=credentials, # type: ignore
# NOTE: If a transport is not provided, we force the client to use the async
# REST transport, as it should.
transport=transport or "rest_asyncio",
client_options=client_options,
client_info=client_info,
Expand Down
24 changes: 14 additions & 10 deletions google/api_core/operations_v1/abstract_operations_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,32 @@ def _get_default_mtls_endpoint(api_endpoint):

@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
info.
"""
This class method should be overridden by the subclasses.
Args:
info (dict): The service account private key info.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.
Returns:
AbstractOperationsClient: The constructed client.
Raises:
NotImplementedError: If the method is called on the base class.
"""
raise NotImplementedError("`from_service_account_info` is not implemented.")

@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.
"""
This class method should be overridden by the subclasses.
Args:
filename (str): The path to the service account private key json
file.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.
Returns:
AbstractOperationsClient: The constructed client.
Raises:
NotImplementedError: If the method is called on the base class.
"""
raise NotImplementedError("`from_service_account_file` is not implemented.")

Expand Down Expand Up @@ -359,14 +359,18 @@ def __init__(
self._transport = transport
else:
Transport = type(self).get_transport_class(transport)
# NOTE: The conditional logic below to initialize the transport can be removed
# once we have feature parity with the sync transport.
if "async" in str(Transport).lower():
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2136): Support the following parameters in async rest.
unsupported_params = {
# TODO(https://github.com/googleapis/python-api-core/issues/715): Add support for `credentials_file` to async REST transport.
"google.api_core.client_options.ClientOptions.credentials_file": client_options.credentials_file,
# TODO(https://github.com/googleapis/python-api-core/issues/716): Add support for `scopes` to async REST transport.
"google.api_core.client_options.ClientOptions.scopes": client_options.scopes,
# TODO(https://github.com/googleapis/python-api-core/issues/717): Add support for `quota_project_id` to async REST transport.
"google.api_core.client_options.ClientOptions.quota_project_id": client_options.quota_project_id,
# TODO(https://github.com/googleapis/python-api-core/issues/718): Add support for `client_cert_source` to async REST transport.
"google.api_core.client_options.ClientOptions.client_cert_source": client_options.client_cert_source,
"google.api_core.client_options.ClientOptions.api_audience": client_options.api_audience,
}
provided_unsupported_params = [
name
Expand Down
4 changes: 4 additions & 0 deletions google/api_core/operations_v1/transports/rest_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def __init__(
url_scheme: str = "https",
http_options: Optional[Dict] = None,
path_prefix: str = "v1",
# TODO(https://github.com/googleapis/python-api-core/issues/715): Add support for `credentials_file` to async REST transport.
# TODO(https://github.com/googleapis/python-api-core/issues/716): Add support for `scopes` to async REST transport.
# TODO(https://github.com/googleapis/python-api-core/issues/717): Add support for `quota_project_id` to async REST transport.
# TODO(https://github.com/googleapis/python-api-core/issues/718): Add support for `client_cert_source` to async REST transport.
) -> None:
"""Instantiate the transport.
Expand Down

0 comments on commit 2af34aa

Please sign in to comment.