From 238d2fb572377f4b2d6ee0ccf97ea0f37df0f4ff Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 7 Dec 2022 10:59:16 -0500 Subject: [PATCH] fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#192) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: https://github.com/googleapis/googleapis/commit/fea43879f83a8d0dacc9353b3f75f8f46d37162f Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .../.coveragerc | 5 -- .../cloud/metastore_v1/gapic_version.py | 16 +++++ .../dataproc_metastore/async_client.py | 62 +++++++++---------- .../services/dataproc_metastore/client.py | 44 ++++++------- .../dataproc_metastore/transports/base.py | 13 ++-- .../async_client.py | 30 ++++----- .../dataproc_metastore_federation/client.py | 24 +++---- .../transports/base.py | 13 ++-- .../cloud/metastore_v1alpha/gapic_version.py | 16 +++++ .../dataproc_metastore/async_client.py | 62 +++++++++---------- .../services/dataproc_metastore/client.py | 44 ++++++------- .../dataproc_metastore/transports/base.py | 13 ++-- .../async_client.py | 30 ++++----- .../dataproc_metastore_federation/client.py | 24 +++---- .../transports/base.py | 13 ++-- .../cloud/metastore_v1beta/gapic_version.py | 16 +++++ .../dataproc_metastore/async_client.py | 62 +++++++++---------- .../services/dataproc_metastore/client.py | 44 ++++++------- .../dataproc_metastore/transports/base.py | 13 ++-- .../async_client.py | 30 ++++----- .../dataproc_metastore_federation/client.py | 24 +++---- .../transports/base.py | 13 ++-- .../release-please-config.json | 3 + ..._dataproc_metastore_create_backup_async.py | 2 +- ..._metastore_create_metadata_import_async.py | 2 +- ...dataproc_metastore_create_service_async.py | 2 +- ..._dataproc_metastore_delete_backup_async.py | 2 +- ...dataproc_metastore_delete_service_async.py | 2 +- ...ataproc_metastore_export_metadata_async.py | 2 +- ...tore_federation_create_federation_async.py | 2 +- ...tore_federation_delete_federation_async.py | 2 +- ...tore_federation_update_federation_async.py | 2 +- ...ataproc_metastore_restore_service_async.py | 2 +- ..._metastore_update_metadata_import_async.py | 2 +- ...dataproc_metastore_update_service_async.py | 2 +- ..._dataproc_metastore_create_backup_async.py | 2 +- ..._metastore_create_metadata_import_async.py | 2 +- ...dataproc_metastore_create_service_async.py | 2 +- ..._dataproc_metastore_delete_backup_async.py | 2 +- ...dataproc_metastore_delete_service_async.py | 2 +- ...ataproc_metastore_export_metadata_async.py | 2 +- ...tore_federation_create_federation_async.py | 2 +- ...tore_federation_delete_federation_async.py | 2 +- ...tore_federation_update_federation_async.py | 2 +- ...ataproc_metastore_restore_service_async.py | 2 +- ..._metastore_update_metadata_import_async.py | 2 +- ...dataproc_metastore_update_service_async.py | 2 +- ..._dataproc_metastore_create_backup_async.py | 2 +- ..._metastore_create_metadata_import_async.py | 2 +- ...dataproc_metastore_create_service_async.py | 2 +- ..._dataproc_metastore_delete_backup_async.py | 2 +- ...dataproc_metastore_delete_service_async.py | 2 +- ...ataproc_metastore_export_metadata_async.py | 2 +- ...tore_federation_create_federation_async.py | 2 +- ...tore_federation_delete_federation_async.py | 2 +- ...tore_federation_update_federation_async.py | 2 +- ...ataproc_metastore_restore_service_async.py | 2 +- ..._metastore_update_metadata_import_async.py | 2 +- ...dataproc_metastore_update_service_async.py | 2 +- .../google-cloud-dataproc-metastore/setup.py | 2 +- .../testing/constraints-3.7.txt | 2 +- 61 files changed, 329 insertions(+), 361 deletions(-) create mode 100644 packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/gapic_version.py create mode 100644 packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/gapic_version.py create mode 100644 packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/gapic_version.py diff --git a/packages/google-cloud-dataproc-metastore/.coveragerc b/packages/google-cloud-dataproc-metastore/.coveragerc index 1d4505e47e46..9ac74e854e15 100644 --- a/packages/google-cloud-dataproc-metastore/.coveragerc +++ b/packages/google-cloud-dataproc-metastore/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/gapic_version.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/gapic_version.py new file mode 100644 index 000000000000..a7807d3a8585 --- /dev/null +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.6.3" # {x-release-please-version} diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/async_client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/async_client.py index e12d2e3f0d9b..4897899cdc3d 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/async_client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -257,7 +258,7 @@ async def list_services( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServicesAsyncPager: r"""Lists services in a project and location. @@ -374,7 +375,7 @@ async def get_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Service: r"""Gets the details of a single service. @@ -480,7 +481,7 @@ async def create_service( service: Optional[metastore.Service] = None, service_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a metastore service in a project and @@ -512,7 +513,7 @@ async def sample_create_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -630,7 +631,7 @@ async def update_service( service: Optional[metastore.Service] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates the parameters of a single service. @@ -659,7 +660,7 @@ async def sample_update_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -764,7 +765,7 @@ async def delete_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single service. @@ -794,7 +795,7 @@ async def sample_delete_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -890,7 +891,7 @@ async def list_metadata_imports( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListMetadataImportsAsyncPager: r"""Lists imports in a service. @@ -1007,7 +1008,7 @@ async def get_metadata_import( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.MetadataImport: r"""Gets details of a single import. @@ -1113,7 +1114,7 @@ async def create_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, metadata_import_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new MetadataImport in a given project and @@ -1145,7 +1146,7 @@ async def sample_create_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1262,7 +1263,7 @@ async def update_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates a single import. @@ -1293,7 +1294,7 @@ async def sample_update_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1397,7 +1398,7 @@ async def export_metadata( request: Optional[Union[metastore.ExportMetadataRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Exports metadata from a service. @@ -1428,7 +1429,7 @@ async def sample_export_metadata(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1495,7 +1496,7 @@ async def restore_service( service: Optional[str] = None, backup: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Restores a service from a backup. @@ -1526,7 +1527,7 @@ async def sample_restore_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1626,7 +1627,7 @@ async def list_backups( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBackupsAsyncPager: r"""Lists backups in a service. @@ -1743,7 +1744,7 @@ async def get_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Backup: r"""Gets details of a single backup. @@ -1847,7 +1848,7 @@ async def create_backup( backup: Optional[metastore.Backup] = None, backup_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new backup in a given project and location. @@ -1878,7 +1879,7 @@ async def sample_create_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1992,7 +1993,7 @@ async def delete_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single backup. @@ -2022,7 +2023,7 @@ async def sample_delete_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2119,14 +2120,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreAsyncClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/client.py index a6a8041b1320..aebc29dbfc13 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -563,7 +564,7 @@ def list_services( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServicesPager: r"""Lists services in a project and location. @@ -680,7 +681,7 @@ def get_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Service: r"""Gets the details of a single service. @@ -786,7 +787,7 @@ def create_service( service: Optional[metastore.Service] = None, service_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a metastore service in a project and @@ -936,7 +937,7 @@ def update_service( service: Optional[metastore.Service] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates the parameters of a single service. @@ -1070,7 +1071,7 @@ def delete_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single service. @@ -1196,7 +1197,7 @@ def list_metadata_imports( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListMetadataImportsPager: r"""Lists imports in a service. @@ -1313,7 +1314,7 @@ def get_metadata_import( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.MetadataImport: r"""Gets details of a single import. @@ -1419,7 +1420,7 @@ def create_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, metadata_import_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new MetadataImport in a given project and @@ -1568,7 +1569,7 @@ def update_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates a single import. @@ -1703,7 +1704,7 @@ def export_metadata( request: Optional[Union[metastore.ExportMetadataRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Exports metadata from a service. @@ -1802,7 +1803,7 @@ def restore_service( service: Optional[str] = None, backup: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Restores a service from a backup. @@ -1933,7 +1934,7 @@ def list_backups( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBackupsPager: r"""Lists backups in a service. @@ -2050,7 +2051,7 @@ def get_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Backup: r"""Gets details of a single backup. @@ -2154,7 +2155,7 @@ def create_backup( backup: Optional[metastore.Backup] = None, backup_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new backup in a given project and location. @@ -2299,7 +2300,7 @@ def delete_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single backup. @@ -2433,14 +2434,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/transports/base.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/transports/base.py index 88693cebd0df..0a9841e8ec91 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/transports/base.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.metastore_v1 import gapic_version as package_version from google.cloud.metastore_v1.types import metastore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DataprocMetastoreTransport(abc.ABC): diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/async_client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/async_client.py index 7b39b466771e..0f987263cf7f 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/async_client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -251,7 +252,7 @@ async def list_federations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFederationsAsyncPager: r"""Lists federations in a project and location. @@ -367,7 +368,7 @@ async def get_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore_federation.Federation: r"""Gets the details of a single federation. @@ -474,7 +475,7 @@ async def create_federation( federation: Optional[metastore_federation.Federation] = None, federation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a metastore federation in a project and @@ -506,7 +507,7 @@ async def sample_create_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -626,7 +627,7 @@ async def update_federation( federation: Optional[metastore_federation.Federation] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates the fields of a federation. @@ -655,7 +656,7 @@ async def sample_update_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -762,7 +763,7 @@ async def delete_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single federation. @@ -792,7 +793,7 @@ async def sample_delete_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -889,14 +890,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreFederationAsyncClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/client.py index fc44e8e76b95..61adde052b81 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -475,7 +476,7 @@ def list_federations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFederationsPager: r"""Lists federations in a project and location. @@ -591,7 +592,7 @@ def get_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore_federation.Federation: r"""Gets the details of a single federation. @@ -698,7 +699,7 @@ def create_federation( federation: Optional[metastore_federation.Federation] = None, federation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a metastore federation in a project and @@ -850,7 +851,7 @@ def update_federation( federation: Optional[metastore_federation.Federation] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates the fields of a federation. @@ -986,7 +987,7 @@ def delete_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single federation. @@ -1120,14 +1121,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreFederationClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/transports/base.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/transports/base.py index b752f9203b00..6159cacc69ce 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/transports/base.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore_federation/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.metastore_v1 import gapic_version as package_version from google.cloud.metastore_v1.types import metastore_federation -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DataprocMetastoreFederationTransport(abc.ABC): diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/gapic_version.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/gapic_version.py new file mode 100644 index 000000000000..a7807d3a8585 --- /dev/null +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.6.3" # {x-release-please-version} diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/async_client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/async_client.py index cda2b648ae73..de33aef2a458 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/async_client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -259,7 +260,7 @@ async def list_services( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServicesAsyncPager: r"""Lists services in a project and location. @@ -376,7 +377,7 @@ async def get_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Service: r"""Gets the details of a single service. @@ -482,7 +483,7 @@ async def create_service( service: Optional[metastore.Service] = None, service_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a metastore service in a project and @@ -514,7 +515,7 @@ async def sample_create_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -632,7 +633,7 @@ async def update_service( service: Optional[metastore.Service] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates the parameters of a single service. @@ -661,7 +662,7 @@ async def sample_update_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -766,7 +767,7 @@ async def delete_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single service. @@ -796,7 +797,7 @@ async def sample_delete_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -892,7 +893,7 @@ async def list_metadata_imports( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListMetadataImportsAsyncPager: r"""Lists imports in a service. @@ -1009,7 +1010,7 @@ async def get_metadata_import( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.MetadataImport: r"""Gets details of a single import. @@ -1115,7 +1116,7 @@ async def create_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, metadata_import_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new MetadataImport in a given project and @@ -1147,7 +1148,7 @@ async def sample_create_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1264,7 +1265,7 @@ async def update_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates a single import. @@ -1295,7 +1296,7 @@ async def sample_update_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1399,7 +1400,7 @@ async def export_metadata( request: Optional[Union[metastore.ExportMetadataRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Exports metadata from a service. @@ -1430,7 +1431,7 @@ async def sample_export_metadata(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1497,7 +1498,7 @@ async def restore_service( service: Optional[str] = None, backup: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Restores a service from a backup. @@ -1528,7 +1529,7 @@ async def sample_restore_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1628,7 +1629,7 @@ async def list_backups( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBackupsAsyncPager: r"""Lists backups in a service. @@ -1745,7 +1746,7 @@ async def get_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Backup: r"""Gets details of a single backup. @@ -1849,7 +1850,7 @@ async def create_backup( backup: Optional[metastore.Backup] = None, backup_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new backup in a given project and location. @@ -1880,7 +1881,7 @@ async def sample_create_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1994,7 +1995,7 @@ async def delete_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single backup. @@ -2024,7 +2025,7 @@ async def sample_delete_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2121,14 +2122,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreAsyncClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/client.py index c7b6cfc668e5..1e7ecd14390a 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -585,7 +586,7 @@ def list_services( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServicesPager: r"""Lists services in a project and location. @@ -702,7 +703,7 @@ def get_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Service: r"""Gets the details of a single service. @@ -808,7 +809,7 @@ def create_service( service: Optional[metastore.Service] = None, service_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a metastore service in a project and @@ -958,7 +959,7 @@ def update_service( service: Optional[metastore.Service] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates the parameters of a single service. @@ -1092,7 +1093,7 @@ def delete_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single service. @@ -1218,7 +1219,7 @@ def list_metadata_imports( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListMetadataImportsPager: r"""Lists imports in a service. @@ -1335,7 +1336,7 @@ def get_metadata_import( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.MetadataImport: r"""Gets details of a single import. @@ -1441,7 +1442,7 @@ def create_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, metadata_import_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new MetadataImport in a given project and @@ -1590,7 +1591,7 @@ def update_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates a single import. @@ -1725,7 +1726,7 @@ def export_metadata( request: Optional[Union[metastore.ExportMetadataRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Exports metadata from a service. @@ -1824,7 +1825,7 @@ def restore_service( service: Optional[str] = None, backup: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Restores a service from a backup. @@ -1955,7 +1956,7 @@ def list_backups( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBackupsPager: r"""Lists backups in a service. @@ -2072,7 +2073,7 @@ def get_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Backup: r"""Gets details of a single backup. @@ -2176,7 +2177,7 @@ def create_backup( backup: Optional[metastore.Backup] = None, backup_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new backup in a given project and location. @@ -2321,7 +2322,7 @@ def delete_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single backup. @@ -2455,14 +2456,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/transports/base.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/transports/base.py index c26bf07cf1b8..e5f753803028 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/transports/base.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.metastore_v1alpha import gapic_version as package_version from google.cloud.metastore_v1alpha.types import metastore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DataprocMetastoreTransport(abc.ABC): diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/async_client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/async_client.py index 45cd140b4d59..6c6ca02583ea 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/async_client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -251,7 +252,7 @@ async def list_federations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFederationsAsyncPager: r"""Lists federations in a project and location. @@ -367,7 +368,7 @@ async def get_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore_federation.Federation: r"""Gets the details of a single federation. @@ -474,7 +475,7 @@ async def create_federation( federation: Optional[metastore_federation.Federation] = None, federation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a metastore federation in a project and @@ -506,7 +507,7 @@ async def sample_create_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -626,7 +627,7 @@ async def update_federation( federation: Optional[metastore_federation.Federation] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates the fields of a federation. @@ -655,7 +656,7 @@ async def sample_update_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -762,7 +763,7 @@ async def delete_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single federation. @@ -792,7 +793,7 @@ async def sample_delete_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -889,14 +890,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreFederationAsyncClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/client.py index ff0108c4e076..939da1ce79fa 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1alpha import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -475,7 +476,7 @@ def list_federations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFederationsPager: r"""Lists federations in a project and location. @@ -591,7 +592,7 @@ def get_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore_federation.Federation: r"""Gets the details of a single federation. @@ -698,7 +699,7 @@ def create_federation( federation: Optional[metastore_federation.Federation] = None, federation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a metastore federation in a project and @@ -850,7 +851,7 @@ def update_federation( federation: Optional[metastore_federation.Federation] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates the fields of a federation. @@ -986,7 +987,7 @@ def delete_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single federation. @@ -1120,14 +1121,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreFederationClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/transports/base.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/transports/base.py index 22106bbccd74..8cc8c88d9d15 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/transports/base.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1alpha/services/dataproc_metastore_federation/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.metastore_v1alpha import gapic_version as package_version from google.cloud.metastore_v1alpha.types import metastore_federation -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DataprocMetastoreFederationTransport(abc.ABC): diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/gapic_version.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/gapic_version.py new file mode 100644 index 000000000000..a7807d3a8585 --- /dev/null +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.6.3" # {x-release-please-version} diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/async_client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/async_client.py index 3e648cc273d8..3317d81c54af 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/async_client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -259,7 +260,7 @@ async def list_services( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServicesAsyncPager: r"""Lists services in a project and location. @@ -376,7 +377,7 @@ async def get_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Service: r"""Gets the details of a single service. @@ -482,7 +483,7 @@ async def create_service( service: Optional[metastore.Service] = None, service_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a metastore service in a project and @@ -514,7 +515,7 @@ async def sample_create_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -632,7 +633,7 @@ async def update_service( service: Optional[metastore.Service] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates the parameters of a single service. @@ -661,7 +662,7 @@ async def sample_update_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -766,7 +767,7 @@ async def delete_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single service. @@ -796,7 +797,7 @@ async def sample_delete_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -892,7 +893,7 @@ async def list_metadata_imports( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListMetadataImportsAsyncPager: r"""Lists imports in a service. @@ -1009,7 +1010,7 @@ async def get_metadata_import( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.MetadataImport: r"""Gets details of a single import. @@ -1115,7 +1116,7 @@ async def create_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, metadata_import_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new MetadataImport in a given project and @@ -1147,7 +1148,7 @@ async def sample_create_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1264,7 +1265,7 @@ async def update_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates a single import. @@ -1295,7 +1296,7 @@ async def sample_update_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1399,7 +1400,7 @@ async def export_metadata( request: Optional[Union[metastore.ExportMetadataRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Exports metadata from a service. @@ -1430,7 +1431,7 @@ async def sample_export_metadata(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1497,7 +1498,7 @@ async def restore_service( service: Optional[str] = None, backup: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Restores a service from a backup. @@ -1528,7 +1529,7 @@ async def sample_restore_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1628,7 +1629,7 @@ async def list_backups( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBackupsAsyncPager: r"""Lists backups in a service. @@ -1745,7 +1746,7 @@ async def get_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Backup: r"""Gets details of a single backup. @@ -1849,7 +1850,7 @@ async def create_backup( backup: Optional[metastore.Backup] = None, backup_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a new backup in a given project and location. @@ -1880,7 +1881,7 @@ async def sample_create_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1994,7 +1995,7 @@ async def delete_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single backup. @@ -2024,7 +2025,7 @@ async def sample_delete_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2121,14 +2122,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreAsyncClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/client.py index 1b57cad576ce..4b328346c3b0 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -585,7 +586,7 @@ def list_services( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListServicesPager: r"""Lists services in a project and location. @@ -702,7 +703,7 @@ def get_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Service: r"""Gets the details of a single service. @@ -808,7 +809,7 @@ def create_service( service: Optional[metastore.Service] = None, service_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a metastore service in a project and @@ -958,7 +959,7 @@ def update_service( service: Optional[metastore.Service] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates the parameters of a single service. @@ -1092,7 +1093,7 @@ def delete_service( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single service. @@ -1218,7 +1219,7 @@ def list_metadata_imports( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListMetadataImportsPager: r"""Lists imports in a service. @@ -1335,7 +1336,7 @@ def get_metadata_import( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.MetadataImport: r"""Gets details of a single import. @@ -1441,7 +1442,7 @@ def create_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, metadata_import_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new MetadataImport in a given project and @@ -1590,7 +1591,7 @@ def update_metadata_import( metadata_import: Optional[metastore.MetadataImport] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates a single import. @@ -1725,7 +1726,7 @@ def export_metadata( request: Optional[Union[metastore.ExportMetadataRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Exports metadata from a service. @@ -1824,7 +1825,7 @@ def restore_service( service: Optional[str] = None, backup: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Restores a service from a backup. @@ -1955,7 +1956,7 @@ def list_backups( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBackupsPager: r"""Lists backups in a service. @@ -2072,7 +2073,7 @@ def get_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore.Backup: r"""Gets details of a single backup. @@ -2176,7 +2177,7 @@ def create_backup( backup: Optional[metastore.Backup] = None, backup_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a new backup in a given project and location. @@ -2321,7 +2322,7 @@ def delete_backup( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single backup. @@ -2455,14 +2456,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/transports/base.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/transports/base.py index ea6d25ecf0b6..fe5440c3f9cb 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/transports/base.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.metastore_v1beta import gapic_version as package_version from google.cloud.metastore_v1beta.types import metastore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DataprocMetastoreTransport(abc.ABC): diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/async_client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/async_client.py index 23634f325601..12fcf40c9463 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/async_client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -251,7 +252,7 @@ async def list_federations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFederationsAsyncPager: r"""Lists federations in a project and location. @@ -367,7 +368,7 @@ async def get_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore_federation.Federation: r"""Gets the details of a single federation. @@ -474,7 +475,7 @@ async def create_federation( federation: Optional[metastore_federation.Federation] = None, federation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a metastore federation in a project and @@ -506,7 +507,7 @@ async def sample_create_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -626,7 +627,7 @@ async def update_federation( federation: Optional[metastore_federation.Federation] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates the fields of a federation. @@ -655,7 +656,7 @@ async def sample_update_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -762,7 +763,7 @@ async def delete_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deletes a single federation. @@ -792,7 +793,7 @@ async def sample_delete_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -889,14 +890,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreFederationAsyncClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/client.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/client.py index 1f0b93104132..21939f3b85a3 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/client.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.metastore_v1beta import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -475,7 +476,7 @@ def list_federations( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFederationsPager: r"""Lists federations in a project and location. @@ -591,7 +592,7 @@ def get_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> metastore_federation.Federation: r"""Gets the details of a single federation. @@ -698,7 +699,7 @@ def create_federation( federation: Optional[metastore_federation.Federation] = None, federation_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a metastore federation in a project and @@ -850,7 +851,7 @@ def update_federation( federation: Optional[metastore_federation.Federation] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates the fields of a federation. @@ -986,7 +987,7 @@ def delete_federation( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deletes a single federation. @@ -1120,14 +1121,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataprocMetastoreFederationClient",) diff --git a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/transports/base.py b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/transports/base.py index f8ee7a5f8146..4a921c5082b9 100644 --- a/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/transports/base.py +++ b/packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1beta/services/dataproc_metastore_federation/transports/base.py @@ -24,18 +24,13 @@ from google.auth import credentials as ga_credentials # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.metastore_v1beta import gapic_version as package_version from google.cloud.metastore_v1beta.types import metastore_federation -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dataproc-metastore", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DataprocMetastoreFederationTransport(abc.ABC): diff --git a/packages/google-cloud-dataproc-metastore/release-please-config.json b/packages/google-cloud-dataproc-metastore/release-please-config.json index 7dab673af4d5..bdd3b5ec8c72 100644 --- a/packages/google-cloud-dataproc-metastore/release-please-config.json +++ b/packages/google-cloud-dataproc-metastore/release-please-config.json @@ -4,7 +4,10 @@ ".": { "release-type": "python", "extra-files": [ + "google/cloud/metastore_v1/gapic_version.py", + "google/cloud/metastore_v1alpha/gapic_version.py", "google/cloud/metastore/gapic_version.py", + "google/cloud/metastore_v1beta/gapic_version.py", { "type": "json", "path": "samples/generated_samples/snippet_metadata_google.cloud.metastore.v1.json", diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_backup_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_backup_async.py index 84dee8b9aace..69442fe38dad 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_backup_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_backup_async.py @@ -49,7 +49,7 @@ async def sample_create_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_metadata_import_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_metadata_import_async.py index f59322fe61fa..e7b3dc840eff 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_metadata_import_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_metadata_import_async.py @@ -49,7 +49,7 @@ async def sample_create_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_service_async.py index f9788719431c..57452922f7f4 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_create_service_async.py @@ -49,7 +49,7 @@ async def sample_create_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_delete_backup_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_delete_backup_async.py index 1cbfc2504514..9ef02b0384d6 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_delete_backup_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_delete_backup_async.py @@ -48,7 +48,7 @@ async def sample_delete_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_delete_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_delete_service_async.py index efca5ed9022d..b7fa01c819eb 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_delete_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_delete_service_async.py @@ -48,7 +48,7 @@ async def sample_delete_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_export_metadata_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_export_metadata_async.py index 2de8e60be05a..c953b0743807 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_export_metadata_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_export_metadata_async.py @@ -49,7 +49,7 @@ async def sample_export_metadata(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_create_federation_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_create_federation_async.py index b7ca22cd98db..b37f7c4dcbd2 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_create_federation_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_create_federation_async.py @@ -49,7 +49,7 @@ async def sample_create_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_delete_federation_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_delete_federation_async.py index 5420dd50f054..7e2111b36f66 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_delete_federation_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_delete_federation_async.py @@ -48,7 +48,7 @@ async def sample_delete_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_update_federation_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_update_federation_async.py index 9fd0c1368833..968cc2864175 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_update_federation_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_federation_update_federation_async.py @@ -47,7 +47,7 @@ async def sample_update_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_restore_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_restore_service_async.py index c73f218a94be..b84971193bc5 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_restore_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_restore_service_async.py @@ -49,7 +49,7 @@ async def sample_restore_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_update_metadata_import_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_update_metadata_import_async.py index 83c8d2a69190..4175af0fd7dc 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_update_metadata_import_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_update_metadata_import_async.py @@ -47,7 +47,7 @@ async def sample_update_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_update_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_update_service_async.py index 12a31230ceb1..b9f8caddce38 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_update_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1_generated_dataproc_metastore_update_service_async.py @@ -47,7 +47,7 @@ async def sample_update_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_backup_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_backup_async.py index 1f85dc5ede0f..5ffea867e040 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_backup_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_backup_async.py @@ -49,7 +49,7 @@ async def sample_create_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_metadata_import_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_metadata_import_async.py index e4ffa1195fe0..a08e07992ab6 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_metadata_import_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_metadata_import_async.py @@ -49,7 +49,7 @@ async def sample_create_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_service_async.py index 7c8e5a4575da..fa6cebb1e474 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_create_service_async.py @@ -49,7 +49,7 @@ async def sample_create_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_delete_backup_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_delete_backup_async.py index 30f05e739470..885d7a0acbc1 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_delete_backup_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_delete_backup_async.py @@ -48,7 +48,7 @@ async def sample_delete_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_delete_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_delete_service_async.py index 321dc1470fad..07c45a9a45c8 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_delete_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_delete_service_async.py @@ -48,7 +48,7 @@ async def sample_delete_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_export_metadata_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_export_metadata_async.py index f850435a0cc8..327a8f6c9929 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_export_metadata_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_export_metadata_async.py @@ -49,7 +49,7 @@ async def sample_export_metadata(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_create_federation_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_create_federation_async.py index 4a02e3dee188..71b27b83d55c 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_create_federation_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_create_federation_async.py @@ -49,7 +49,7 @@ async def sample_create_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_delete_federation_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_delete_federation_async.py index 5201c81129b4..1b3ad6a7d487 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_delete_federation_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_delete_federation_async.py @@ -48,7 +48,7 @@ async def sample_delete_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_update_federation_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_update_federation_async.py index 9ea30149477f..e5ee98275b8c 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_update_federation_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_federation_update_federation_async.py @@ -47,7 +47,7 @@ async def sample_update_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_restore_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_restore_service_async.py index e6165ba2f00e..ab29aa1a2fe8 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_restore_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_restore_service_async.py @@ -49,7 +49,7 @@ async def sample_restore_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_update_metadata_import_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_update_metadata_import_async.py index b77dc41e036a..6aeece1d8d3e 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_update_metadata_import_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_update_metadata_import_async.py @@ -47,7 +47,7 @@ async def sample_update_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_update_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_update_service_async.py index 39f66a4b4f9c..d71597341736 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_update_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1alpha_generated_dataproc_metastore_update_service_async.py @@ -47,7 +47,7 @@ async def sample_update_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_backup_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_backup_async.py index 4358418b2964..3275001aece1 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_backup_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_backup_async.py @@ -49,7 +49,7 @@ async def sample_create_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_metadata_import_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_metadata_import_async.py index f71f7bef2d76..db6db5737356 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_metadata_import_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_metadata_import_async.py @@ -49,7 +49,7 @@ async def sample_create_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_service_async.py index 1241f50d7b42..b241e92f2dad 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_create_service_async.py @@ -49,7 +49,7 @@ async def sample_create_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_delete_backup_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_delete_backup_async.py index 99e756d413ae..c8a7235843c2 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_delete_backup_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_delete_backup_async.py @@ -48,7 +48,7 @@ async def sample_delete_backup(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_delete_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_delete_service_async.py index 6b32e600415b..f71215a37878 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_delete_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_delete_service_async.py @@ -48,7 +48,7 @@ async def sample_delete_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_export_metadata_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_export_metadata_async.py index 4113b76498b2..87373a6846db 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_export_metadata_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_export_metadata_async.py @@ -49,7 +49,7 @@ async def sample_export_metadata(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_create_federation_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_create_federation_async.py index ba4eafade338..a6b80588e581 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_create_federation_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_create_federation_async.py @@ -49,7 +49,7 @@ async def sample_create_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_delete_federation_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_delete_federation_async.py index 8efa6bd2e360..1190fc290c3f 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_delete_federation_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_delete_federation_async.py @@ -48,7 +48,7 @@ async def sample_delete_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_update_federation_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_update_federation_async.py index ab081cab290e..103745180c70 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_update_federation_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_federation_update_federation_async.py @@ -47,7 +47,7 @@ async def sample_update_federation(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_restore_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_restore_service_async.py index e6537567bcfa..94420c196958 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_restore_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_restore_service_async.py @@ -49,7 +49,7 @@ async def sample_restore_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_update_metadata_import_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_update_metadata_import_async.py index 35e611f51658..003b7cf36093 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_update_metadata_import_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_update_metadata_import_async.py @@ -47,7 +47,7 @@ async def sample_update_metadata_import(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_update_service_async.py b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_update_service_async.py index 64971eca07c6..98ecc0e2993f 100644 --- a/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_update_service_async.py +++ b/packages/google-cloud-dataproc-metastore/samples/generated_samples/metastore_v1beta_generated_dataproc_metastore_update_service_async.py @@ -47,7 +47,7 @@ async def sample_update_service(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-dataproc-metastore/setup.py b/packages/google-cloud-dataproc-metastore/setup.py index 0b14fb2c2f8a..0c9f9e0096e1 100644 --- a/packages/google-cloud-dataproc-metastore/setup.py +++ b/packages/google-cloud-dataproc-metastore/setup.py @@ -36,7 +36,7 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", ] diff --git a/packages/google-cloud-dataproc-metastore/testing/constraints-3.7.txt b/packages/google-cloud-dataproc-metastore/testing/constraints-3.7.txt index 6f3158cc2034..6c44adfea7ee 100644 --- a/packages/google-cloud-dataproc-metastore/testing/constraints-3.7.txt +++ b/packages/google-cloud-dataproc-metastore/testing/constraints-3.7.txt @@ -4,6 +4,6 @@ # Pin the version to the lower bound. # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.33.2 +google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5