8000 fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#192) · googleapis/google-cloud-python@238d2fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 238d2fb

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#192)
* 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: googleapis/googleapis@fea4387 Source-Link: googleapis/googleapis-gen@387b734 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 <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 6fa8c4b commit 238d2fb

File tree

61 files changed

+329
-361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+329
-361
lines changed

packages/google-cloud-dataproc-metastore/.coveragerc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ exclude_lines =
1010
pragma: NO COVER
1111
# Ignore debug-only repr
1212
def __repr__
13-
# Ignore pkg_resources exceptions.
14-
# This is added at the module level as a safeguard for if someone
15-
# generates the code and tries to run it without pip installing. This
16-
# makes it virtually impossible to test properly.
17-
except pkg_resources.DistributionNotFound
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "1.6.3" # {x-release-please-version}

packages/google-cloud-dataproc-metastore/google/cloud/metastore_v1/services/dataproc_metastore/async_client.py

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
from google.api_core.client_options import ClientOptions
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
from google.oauth2 import service_account # type: ignore
37-
import pkg_resources
37+
38+
from google.cloud.metastore_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -257,7 +258,7 @@ async def list_services(
257258
*,
258259
parent: Optional[str] = None,
259260
retry: OptionalRetry = gapic_v1.method.DEFAULT,
260-
timeout: Optional[float] = None,
261+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
261262
metadata: Sequence[Tuple[str, str]] = (),
262263
) -> pagers.ListServicesAsyncPager:
263264
r"""Lists services in a project and location.
@@ -374,7 +375,7 @@ async def get_service(
374375
*,
375376
name: Optio F42D nal[str] = None,
376377
retry: OptionalRetry = gapic_v1.method.DEFAULT,
377-
timeout: Optional[float] = None,
378+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
378379
metadata: Sequence[Tuple[str, str]] = (),
379380
) -> metastore.Service:
380381
r"""Gets the details of a single service.
@@ -480,7 +481,7 @@ async def create_service(
480481
service: Optional[metastore.Service] = None,
481482
service_id: Optional[str] = None,
482483
retry: OptionalRetry = gapic_v1.method.DEFAULT,
483-
timeout: Optional[float] = None,
484+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
484485
metadata: Sequence[Tuple[str, str]] = (),
485486
) -> operation_async.AsyncOperation:
486487
r"""Creates a metastore service in a project and
@@ -512,7 +513,7 @@ async def sample_create_service():
512513
513514
print("Waiting for operation to complete...")
514515
515-
response = await operation.result()
516+
response = (await operation).result()
516517
517518
# Handle the response
518519
print(response)
@@ -630,7 +631,7 @@ async def update_service(
630631
service: Optional[metastore.Service] = None,
631632
update_mask: Optional[field_mask_pb2.FieldMask] = None,
632633
retry: OptionalRetry = gapic_v1.method.DEFAULT,
633-
timeout: Optional[float] = None,
634+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
634635
metadata: Sequence[Tuple[str, str]] = (),
635636
) -> operation_async.AsyncOperation:
636637
r"""Updates the parameters of a single service.
@@ -659,7 +660,7 @@ async def sample_update_service():
659660
660661
print("Waiting for operation to complete...")
661662
662-
response = await operation.result()
663+
response = (await operation).result()
663664
664665
# Handle the response
665666
print(response)
@@ -764,7 +765,7 @@ async def delete_service(
764765
*,
765766
name: Optional[str] = None,
766767
retry: OptionalRetry = gapic_v1.method.DEFAULT,
767-
timeout: Optional[float] = None,
768+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
768769
metadata: Sequence[Tuple[str, str]] = (),
769770
) -> operation_async.AsyncOperation:
770771
r"""Deletes a single service.
@@ -794,7 +795,7 @@ async def sample_delete_service():
794795
795796
print("Waiting for operation to complete...")
796797
797-
response = await operation.result()
798+
response = (await operation).result()
798799
799800
# Handle the response
800801
print(response)
@@ -890,7 +891,7 @@ async def list_metadata_imports(
890891
*,
891892
parent: Optional[str] = None,
892893
retry: OptionalRetry = gapic_v1.method.DEFAULT,
893-
timeout: Optional[float] = None,
894+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
894895
metadata: Sequence[Tuple[str, str]] = (),
895896
) -> pagers.ListMetadataImportsAsyncPager:
896897
r"""Lists imports in a service.
@@ -1007,7 +1008,7 @@ async def get_metadata_import(
10071008
*,
10081009
name: Optional[str] = None,
10091010
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1010-
timeout: Optional[float] = None,
1011+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10111012
metadata: Sequence[Tuple[str, str]] = (),
10121013
) -> metastore.MetadataImport:
10131014
r"""Gets details of a single import.
@@ -1113,7 +1114,7 @@ async def create_metadata_import(
11131114
metadata_import: Optional[metastore.MetadataImport] = None,
11141115
metadata_import_id: Optional[str] = None,
11151116
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1116-
timeout: Optional[float] = None,
1117+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11171118
metadata: Sequence[Tuple[str, str]] = (),
11181119
) -> operation_async.AsyncOperation:
11191120
r"""Creates a new MetadataImport in a given project and
@@ -1145,7 +1146,7 @@ async def sample_create_metadata_import():
11451146
11461147
print("Waiting for operation to complete...")
11471148
1148-
response = await operation.result()
1149+
response = (await operation).result()
11491150
11501151
# Handle the response
11511152
print(response)
@@ -1262,7 +1263,7 @@ async def update_metadata_import(
12621263
metadata_import: Optional[metastore.MetadataImport] = None,
12631264
update_mask: Optional[field_mask_pb2.FieldMask] = None,
12641265
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1265-
timeout: Optional[float] = None,
1266+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12661267
metadata: Sequence[Tuple[str, str]] = (),
12671268
) -> operation_async.AsyncOperation:
12681269
r"""Updates a single import.
@@ -1293,7 +1294,7 @@ async def sample_update_metadata_import():
12931294
12941295
print("Waiting for operation to complete...")
12951296
1296-
response = await operation.result()
1297+
response = (await operation).result()
12971298
12981299
# Handle the response
12991300
print(response)
@@ -1397,7 +1398,7 @@ async def export_metadata(
13971398
request: Optional[Union[metastore.ExportMetadataRequest, dict]] = None,
13981399
*,
13991400
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1400-
timeout: Optional[float] = None,
1401+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14011402
metadata: Sequence[Tuple[str, str]] = (),
14021403
) -> operation_async.AsyncOperation:
14031404
r"""Exports metadata from a service.
@@ -1428,7 +1429,7 @@ async def sample_export_metadata():
14281429
14291430
print("Waiting for operation to complete...")
14301431
1431-
response = await operation.result()
1432+
response = (await operation).result()
14321433
14331434
# Handle the response
14341435
print(response)
@@ -1495,7 +1496,7 @@ async def restore_service(
14951496
service: Optional[str] = None,
14961497
backup: Optional[str] = None,
14971498
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1498-
timeout: Optional[float] = None,
1499+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14991500
metadata: Sequence[Tuple[str, str]] = (),
15001501
) -> operation_async.AsyncOperation:
15011502
r"""Restores a service from a backup.
@@ -1526,7 +1527,7 @@ async def sample_restore_service():
15261527
15271528
print("Waiting for operation to complete...")
15281529
1529-
response = await operation.result()
1530+
response = (await operation).result()
15301531
15311532
# Handle the response
15321533
print(response)
@@ -1626,7 +1627,7 @@ async def list_backups(
16261627
*,
16271628
parent: Optional[str] = None,
16281629
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1629-
timeout: Optional[float] = None,
1630+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16301631
metadata: Sequence[Tuple[str, str]] = (),
16311632
) -> pagers.ListBackupsAsyncPager:
16321633
r"""Lists backups in a service.
@@ -1743,7 +1744,7 @@ async def get_backup(
17431744
*,
17441745
name: Optional[str] = None,
17451746
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1746-
timeout: Optional[float] = None,
1747+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17471748
metadata: Sequence[Tuple[str, str]] = (),
17481749
) -> metastore.Backup:
17491750
r"""Ge 10000 ts details of a single backup.
@@ -1847,7 +1848,7 @@ async def create_backup(
18471848
backup: Optional[metastore.Backup] = None,
18481849
backup_id: Optional[str] = None,
18491850
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1850-
timeout: Optional[float] = None,
1851+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18511852
metadata: Sequence[Tuple[str, str]] = (),
18521853
) -> operation_async.AsyncOperation:
18531854
r"""Creates a new backup in a given project and location.
@@ -1878,7 +1879,7 @@ async def sample_create_backup():
18781879
18791880
print("Waiting for operation to complete...")
18801881
1881-
response = await operation.result()
1882+
response = (await operation).result()
18821883
18831884
# Handle the response
18841885
print(response)
@@ -1992,7 +1993,7 @@ async def delete_backup(
19921993
*,
19931994
name: Optional[str] = None,
19941995
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1995-
timeout: Optional[float] = None,
1996+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
19961997
metadata: Sequence[Tuple[str, str]] = (),
19971998
) -> operation_async.AsyncOperation:
19981999
r"""Deletes a single backup.
@@ -2022,7 +2023,7 @@ async def sample_delete_backup():
20222023
20232024
print("Waiting for operation to complete...")
20242025
2025-
response = await operation.result()
2026+
response = (await operation).result()
20262027
20272028
# Handle the response
20282029
print(response)
@@ -2119,14 +2120,9 @@ async def __aexit__(self, exc_type, exc, tb):
21192120
await self.transport.close()
21202121

21212122

2122-
try:
2123-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.Clien 75DC tInfo(
2124-
gapic_version=pkg_resources.get_distribution(
2125-
"google-cloud-dataproc-metastore",
2126-
).version,
2127-
)
2128-
except pkg_resources.DistributionNotFound:
2129-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
2123+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
2124+
gapic_version=package_version.__version__
2125+
)
21302126

21312127

21322128
__all__ = ("DataprocMetastoreAsyncClient",)

0 commit comments

Comments
 (0)
0