Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit d164752

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#154)
* 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: 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 <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 7088952 commit d164752

12 files changed

Lines changed: 55 additions & 56 deletions

.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.5.3" # {x-release-please-version}

google/cloud/data_fusion_v1/services/data_fusion/async_client.py

Lines changed: 16 additions & 20 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.data_fusion_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -224,7 +225,7 @@ async def list_available_versions(
224225
*,
225226
parent: Optional[str] = None,
226227
retry: OptionalRetry = gapic_v1.method.DEFAULT,
227-
timeout: Optional[float] = None,
228+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
228229
metadata: Sequence[Tuple[str, str]] = (),
229230
) -> pagers.ListAvailableVersionsAsyncPager:
230231
r"""Lists possible versions for Data Fusion instances in
@@ -341,7 +342,7 @@ async def list_instances(
341342
request: Optional[Union[datafusion.ListInstancesRequest, dict]] = None,
342343
*,
343344
retry: OptionalRetry = gapic_v1.method.DEFAULT,
344-
timeout: Optional[float] = None,
345+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
345346
metadata: Sequence[Tuple[str, str]] = (),
346347
) -> pagers.ListInstancesAsyncPager:
347348
r"""Lists Data Fusion instances in the specified project
@@ -435,7 +436,7 @@ async def get_instance(
435436
request: Optional[Union[datafusion.GetInstanceRequest, dict]] = None,
436437
*,
437438
retry: OptionalRetry = gapic_v1.method.DEFAULT,
438-
timeout: Optional[float] = None,
439+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
439440
metadata: Sequence[Tuple[str, str]] = (),
440441
) -> datafusion.Instance:
441442
r"""Gets details of a single Data Fusion instance.
@@ -516,7 +517,7 @@ async def create_instance(
516517
instance: Optional[datafusion.Instance] = None,
517518
instance_id: Optional[str] = None,
518519
retry: OptionalRetry = gapic_v1.method.DEFAULT,
519-
timeout: Optional[float] = None,
520+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
520521
metadata: Sequence[Tuple[str, str]] = (),
521522
) -> operation_async.AsyncOperation:
522523
r"""Creates a new Data Fusion instance in the specified
@@ -548,7 +549,7 @@ async def sample_create_instance():
548549
549550
print("Waiting for operation to complete...")
550551
551-
response = await operation.result()
552+
response = (await operation).result()
552553
553554
# Handle the response
554555
print(response)
@@ -652,7 +653,7 @@ async def delete_instance(
652653
*,
653654
name: Optional[str] = None,
654655
retry: OptionalRetry = gapic_v1.method.DEFAULT,
655-
timeout: Optional[float] = None,
656+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
656657
metadata: Sequence[Tuple[str, str]] = (),
657658
) -> operation_async.AsyncOperation:
658659
r"""Deletes a single Date Fusion instance.
@@ -682,7 +683,7 @@ async def sample_delete_instance():
682683
683684
print("Waiting for operation to complete...")
684685
685-
response = await operation.result()
686+
response = (await operation).result()
686687
687688
# Handle the response
688689
print(response)
@@ -778,7 +779,7 @@ async def update_instance(
778779
instance: Optional[datafusion.Instance] = None,
779780
update_mask: Optional[field_mask_pb2.FieldMask] = None,
780781
retry: OptionalRetry = gapic_v1.method.DEFAULT,
781-
timeout: Optional[float] = None,
782+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
782783
metadata: Sequence[Tuple[str, str]] = (),
783784
) -> operation_async.AsyncOperation:
784785
r"""Updates a single Data Fusion instance.
@@ -811,7 +812,7 @@ async def sample_update_instance():
811812
812813
print("Waiting for operation to complete...")
813814
814-
response = await operation.result()
815+
response = (await operation).result()
815816
816817
# Handle the response
817818
print(response)
@@ -919,7 +920,7 @@ async def restart_instance(
919920
request: Optional[Union[datafusion.RestartInstanceRequest, dict]] = None,
920921
*,
921922
retry: OptionalRetry = gapic_v1.method.DEFAULT,
922-
timeout: Optional[float] = None,
923+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
923924
metadata: Sequence[Tuple[str, str]] = (),
924925
) -> operation_async.AsyncOperation:
925926
r"""Restart a single Data Fusion instance.
@@ -950,7 +951,7 @@ async def sample_restart_instance():
950951
951952
print("Waiting for operation to complete...")
952953
953-
response = await operation.result()
954+
response = (await operation).result()
954955
955956
# Handle the response
956957
print(response)
@@ -1017,14 +1018,9 @@ async def __aexit__(self, exc_type, exc, tb):
10171018
await self.transport.close()
10181019

10191020

1020-
try:
1021-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1022-
gapic_version=pkg_resources.get_distribution(
1023-
"google-cloud-data-fusion",
1024-
).version,
1025-
)
1026-
except pkg_resources.DistributionNotFound:
1027-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1021+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1022+
gapic_version=package_version.__version__
1023+
)
10281024

10291025

10301026
__all__ = ("DataFusionAsyncClient",)

google/cloud/data_fusion_v1/services/data_fusion/client.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
from google.auth.transport import mtls # type: ignore
3939
from google.auth.transport.grpc import SslCredentials # type: ignore
4040
from google.oauth2 import service_account # type: ignore
41-
import pkg_resources
41+
42+
from google.cloud.data_fusion_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -477,7 +478,7 @@ def list_available_versions(
477478
*,
478479
parent: Optional[str] = None,
479480
retry: OptionalRetry = gapic_v1.method.DEFAULT,
480-
timeout: Optional[float] = None,
481+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
481482
metadata: Sequence[Tuple[str, str]] = (),
482483
) -> pagers.ListAvailableVersionsPager:
483484
r"""Lists possible versions for Data Fusion instances in
@@ -594,7 +595,7 @@ def list_instances(
594595
request: Optional[Union[datafusion.ListInstancesRequest, dict]] = None,
595596
*,
596597
retry: OptionalRetry = gapic_v1.method.DEFAULT,
597-
timeout: Optional[float] = None,
598+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
598599
metadata: Sequence[Tuple[str, str]] = (),
599600
) -> pagers.ListInstancesPager:
600601
r"""Lists Data Fusion instances in the specified project
@@ -689,7 +690,7 @@ def get_instance(
689690
request: Optional[Union[datafusion.GetInstanceRequest, dict]] = None,
690691
*,
691692
retry: OptionalRetry = gapic_v1.method.DEFAULT,
692-
timeout: Optional[float] = None,
693+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
693694
metadata: Sequence[Tuple[str, str]] = (),
694695
) -> datafusion.Instance:
695696
r"""Gets details of a single Data Fusion instance.
@@ -771,7 +772,7 @@ def create_instance(
771772
instance: Optional[datafusion.Instance] = None,
772773
instance_id: Optional[str] = None,
773774
retry: OptionalRetry = gapic_v1.method.DEFAULT,
774-
timeout: Optional[float] = None,
775+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
775776
metadata: Sequence[Tuple[str, str]] = (),
776777
) -> operation.Operation:
777778
r"""Creates a new Data Fusion instance in the specified
@@ -907,7 +908,7 @@ def delete_instance(
907908
*,
908909
name: Optional[str] = None,
909910
retry: OptionalRetry = gapic_v1.method.DEFAULT,
910-
timeout: Optional[float] = None,
911+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
911912
metadata: Sequence[Tuple[str, str]] = (),
912913
) -> operation.Operation:
913914
r"""Deletes a single Date Fusion instance.
@@ -1033,7 +1034,7 @@ def update_instance(
10331034
instance: Optional[datafusion.Instance] = None,
10341035
update_mask: Optional[field_mask_pb2.FieldMask] = None,
10351036
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1036-
timeout: Optional[float] = None,
1037+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10371038
metadata: Sequence[Tuple[str, str]] = (),
10381039
) -> operation.Operation:
10391040
r"""Updates a single Data Fusion instance.
@@ -1174,7 +1175,7 @@ def restart_instance(
11741175
request: Optional[Union[datafusion.RestartInstanceRequest, dict]] = None,
11751176
*,
11761177
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1177-
timeout: Optional[float] = None,
1178+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11781179
metadata: Sequence[Tuple[str, str]] = (),
11791180
) -> operation.Operation:
11801181
r"""Restart a single Data Fusion instance.
@@ -1280,14 +1281,9 @@ def __exit__(self, type, value, traceback):
12801281
self.transport.close()
12811282

12821283

1283-
try:
1284-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1285-
gapic_version=pkg_resources.get_distribution(
1286-
"google-cloud-data-fusion",
1287-
).version,
1288-
)
1289-
except pkg_resources.DistributionNotFound:
1290-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1284+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1285+
gapic_version=package_version.__version__
1286+
)
12911287

12921288

12931289
__all__ = ("DataFusionClient",)

google/cloud/data_fusion_v1/services/data_fusion/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,13 @@
2424
from google.auth import credentials as ga_credentials # type: ignore
2525
from google.longrunning import operations_pb2 # type: ignore
2626
from google.oauth2 import service_account # type: ignore
27-
import pkg_resources
2827

28+
from google.cloud.data_fusion_v1 import gapic_version as package_version
2929
from google.cloud.data_fusion_v1.types import datafusion
3030

31-
try:
32-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution(
34-
"google-cloud-data-fusion",
35-
).version,
36-
)
37-
except pkg_resources.DistributionNotFound:
38-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
31+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32+
gapic_version=package_version.__version__
33+
)
3934

4035

4136
class DataFusionTransport(abc.ABC):

release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
".": {
55
"release-type": "python",
66
"extra-files": [
7+
"google/cloud/data_fusion_v1/gapic_version.py",
78
"google/cloud/data_fusion/gapic_version.py",
89
{
910
"type": "json",

samples/generated_samples/datafusion_v1_generated_data_fusion_create_instance_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def sample_create_instance():
4949

5050
print("Waiting for operation to complete...")
5151

52-
response = await operation.result()
52+
response = (await operation).result()
5353

5454
# Handle the response
5555
print(response)

samples/generated_samples/datafusion_v1_generated_data_fusion_delete_instance_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def sample_delete_instance():
4848

4949
print("Waiting for operation to complete...")
5050

51-
response = await operation.result()
51+
response = (await operation).result()
5252

5353
# Handle the response
5454
print(response)

samples/generated_samples/datafusion_v1_generated_data_fusion_restart_instance_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def sample_restart_instance():
4848

4949
print("Waiting for operation to complete...")
5050

51-
response = await operation.result()
51+
response = (await operation).result()
5252

5353
# Handle the response
5454
print(response)

samples/generated_samples/datafusion_v1_generated_data_fusion_update_instance_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def sample_update_instance():
5151

5252
print("Waiting for operation to complete...")
5353

54-
response = await operation.result()
54+
response = (await operation).result()
5555

5656
# Handle the response
5757
print(response)

0 commit comments

Comments
 (0)