Skip to content

Commit 12d66b3

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#450)
* 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 02c0ea1 commit 12d66b3

File tree

24 files changed

+300
-349
lines changed

24 files changed

+300
-349
lines changed

packages/google-cloud-datacatalog/.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__ = "3.9.3" # {x-release-please-version}

packages/google-cloud-datacatalog/google/cloud/datacatalog_v1/services/data_catalog/async_client.py

Lines changed: 37 additions & 41 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.datacatalog_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -249,7 +250,7 @@ async def search_catalog(
249250
scope: Optional[datacatalog.SearchCatalogRequest.Scope] = None,
250251
query: Optional[str] = None,
251252
retry: OptionalRetry = gapic_v1.method.DEFAULT,
252-
timeout: Optional[float] = None,
253+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
253254
metadata: Sequence[Tuple[str, str]] = (),
254255
) -> pagers.SearchCatalogAsyncPager:
255256
r"""Searches Data Catalog for multiple resources like entries and
@@ -408,7 +409,7 @@ async def create_entry_group(
408409
entry_group_id: Optional[str] = None,
409410
entry_group: Optional[datacatalog.EntryGroup] = None,
410411
retry: OptionalRetry = gapic_v1.method.DEFAULT,
411-
timeout: Optional[float] = None,
412+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
412413
metadata: Sequence[Tuple[str, str]] = (),
413414
) -> datacatalog.EntryGroup:
414415
r"""Creates an entry group.
@@ -570,7 +571,7 @@ async def get_entry_group(
570571
name: Optional[str] = None,
571572
read_mask: Optional[field_mask_pb2.FieldMask] = None,
572573
retry: OptionalRetry = gapic_v1.method.DEFAULT,
573-
timeout: Optional[float] = None,
574+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
574575
metadata: Sequence[Tuple[str, str]] = (),
575576
) -> datacatalog.EntryGroup:
576577
r"""Gets an entry group.
@@ -694,7 +695,7 @@ async def update_entry_group(
694695
entry_group: Optional[datacatalog.EntryGroup] = None,
695696
update_mask: Optional[field_mask_pb2.FieldMask] = None,
696697
retry: OptionalRetry = gapic_v1.method.DEFAULT,
697-
timeout: Optional[float] = None,
698+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
698699
metadata: Sequence[Tuple[str, str]] = (),
699700
) -> datacatalog.EntryGroup:
700701
r"""Updates an entry group.
@@ -819,7 +820,7 @@ async def delete_entry_group(
819820
*,
820821
name: Optional[str] = None,
821822
retry: OptionalRetry = gapic_v1.method.DEFAULT,
822-
timeout: Optional[float] = None,
823+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
823824
metadata: Sequence[Tuple[str, str]] = (),
824825
) -> None:
825826
r"""Deletes an entry group.
@@ -914,7 +915,7 @@ async def list_entry_groups(
914915
*,
915916
parent: Optional[str] = None,
916917
retry: OptionalRetry = gapic_v1.method.DEFAULT,
917-
timeout: Optional[float] = None,
918+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
918919
metadata: Sequence[Tuple[str, str]] = (),
919920
) -> pagers.ListEntryGroupsAsyncPager:
920921
r"""Lists entry groups.
@@ -1041,7 +1042,7 @@ async def create_entry(
10411042
entry_id: Optional[str] = None,
10421043
entry: Optional[datacatalog.Entry] = None,
10431044
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1044-
timeout: Optional[float] = None,
1045+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10451046
metadata: Sequence[Tuple[str, str]] = (),
10461047
) -> datacatalog.Entry:
10471048
r"""Creates an entry.
@@ -1194,7 +1195,7 @@ async def update_entry(
11941195
entry: Optional[datacatalog.Entry] = None,
11951196
update_mask: Optional[field_mask_pb2.FieldMask] = None,
11961197
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1197-
timeout: Optional[float] = None,
1198+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11981199
metadata: Sequence[Tuple[str, str]] = (),
11991200
) -> datacatalog.Entry:
12001201
r"""Updates an existing entry.
@@ -1354,7 +1355,7 @@ async def delete_entry(
13541355
*,
13551356
name: Optional[str] = None,
13561357
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1357-
timeout: Optional[float] = None,
1358+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13581359
metadata: Sequence[Tuple[str, str]] = (),
13591360
) -> None:
13601361
r"""Deletes an existing entry.
@@ -1453,7 +1454,7 @@ async def get_entry(
14531454
*,
14541455
name: Optional[str] = None,
14551456
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1456-
timeout: Optional[float] = None,
1457+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14571458
metadata: Sequence[Tuple[str, str]] = (),
14581459
) -> datacatalog.Entry:
14591460
r"""Gets an entry.
@@ -1572,7 +1573,7 @@ async def lookup_entry(
15721573
request: Optional[Union[datacatalog.LookupEntryRequest, dict]] = None,
15731574
*,
15741575
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1575-
timeout: Optional[float] = None,
1576+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15761577
metadata: Sequence[Tuple[str, str]] = (),
15771578
) -> datacatalog.Entry:
15781579
r"""Gets an entry by its target resource name.
@@ -1667,7 +1668,7 @@ async def list_entries(
16671668
*,
16681669
parent: Optional[str] = None,
16691670
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1670-
timeout: Optional[float] = None,
1671+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16711672
metadata: Sequence[Tuple[str, str]] = (),
16721673
) -> pagers.ListEntriesAsyncPager:
16731674
r"""Lists entries.
@@ -1795,7 +1796,7 @@ async def modify_entry_overview(
17951796
request: Optional[Union[datacatalog.ModifyEntryOverviewRequest, dict]] = None,
17961797
*,
17971798
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1798-
timeout: Optional[float] = None,
1799+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17991800
metadata: Sequence[Tuple[str, str]] = (),
18001801
) -> datacatalog.EntryOverview:
18011802
r"""Modifies entry overview, part of the business context of an
@@ -1880,7 +1881,7 @@ async def modify_entry_contacts(
18801881
request: Optional[Union[datacatalog.ModifyEntryContactsRequest, dict]] = None,
18811882
*,
18821883
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1883-
timeout: Optional[float] = None,
1884+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18841885
metadata: Sequence[Tuple[str, str]] = (),
18851886
) -> datacatalog.Contacts:
18861887
r"""Modifies contacts, part of the business context of an
@@ -1966,7 +1967,7 @@ async def create_tag_template(
19661967
tag_template_id: Optional[str] = None,
19671968
tag_template: Optional[tags.TagTemplate] = None,
19681969
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1969-
timeout: Optional[float] = None,
1970+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
19701971
metadata: Sequence[Tuple[str, str]] = (),
19711972
) -> tags.TagTemplate:
19721973
r"""Creates a tag template.
@@ -2104,7 +2105,7 @@ async def get_tag_template(
21042105
*,
21052106
name: Optional[str] = None,
21062107
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2107-
timeout: Optional[float] = None,
2108+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
21082109
metadata: Sequence[Tuple[str, str]] = (),
21092110
) -> tags.TagTemplate:
21102111
r"""Gets a tag template.
@@ -2216,7 +2217,7 @@ async def update_tag_template(
22162217
tag_template: Optional[tags.TagTemplate] = None,
22172218
update_mask: Optional[field_mask_pb2.FieldMask] = None,
22182219
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2219-
timeout: Optional[float] = None,
2220+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
22202221
metadata: Sequence[Tuple[str, str]] = (),
22212222
) -> tags.TagTemplate:
22222223
r"""Updates a tag template.
@@ -2356,7 +2357,7 @@ async def delete_tag_template(
23562357
name: Optional[str] = None,
23572358
force: Optional[bool] = None,
23582359
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2359-
timeout: Optional[float] = None,
2360+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
23602361
metadata: Sequence[Tuple[str, str]] = (),
23612362
) -> None:
23622363
r"""Deletes a tag template and all tags that use it.
@@ -2467,7 +2468,7 @@ async def create_tag_template_field(
24672468
tag_template_field_id: Optional[str] = None,
24682469
tag_template_field: Optional[tags.TagTemplateField] = None,
24692470
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2470-
timeout: Optional[float] = None,
2471+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
24712472
metadata: Sequence[Tuple[str, str]] = (),
24722473
) -> tags.TagTemplateField:
24732474
r"""Creates a field in a tag template.
@@ -2610,7 +2611,7 @@ async def update_tag_template_field(
26102611
tag_template_field: Optional[tags.TagTemplateField] = None,
26112612
update_mask: Optional[field_mask_pb2.FieldMask] = None,
26122613
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2613-
timeout: Optional[float] = None,
2614+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
26142615
metadata: Sequence[Tuple[str, str]] = (),
26152616
) -> tags.TagTemplateField:
26162617
r"""Updates a field in a tag template.
@@ -2758,7 +2759,7 @@ async def rename_tag_template_field(
27582759
name: Optional[str] = None,
27592760
new_tag_template_field_id: Optional[str] = None,
27602761
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2761-
timeout: Optional[float] = None,
2762+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
27622763
metadata: Sequence[Tuple[str, str]] = (),
27632764
) -> tags.TagTemplateField:
27642765
r"""Renames a field in a tag template.
@@ -2878,7 +2879,7 @@ async def rename_tag_template_field_enum_value(
28782879
name: Optional[str] = None,
28792880
new_enum_value_display_name: Optional[str] = None,
28802881
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2881-
timeout: Optional[float] = None,
2882+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
28822883
metadata: Sequence[Tuple[str, str]] = (),
28832884
) -> tags.TagTemplateField:
28842885
r"""Renames an enum value in a tag template.
@@ -2994,7 +2995,7 @@ async def delete_tag_template_field(
29942995
name: Optional[str] = None,
29952996
force: Optional[bool] = None,
29962997
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2997-
timeout: Optional[float] = None,
2998+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
29982999
metadata: Sequence[Tuple[str, str]] = (),
29993000
) -> None:
30003001
r"""Deletes a field in a tag template and all uses of this field
@@ -3103,7 +3104,7 @@ async def create_tag(
31033104
parent: Optional[str] = None,
31043105
tag: Optional[tags.Tag] = None,
31053106
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3106-
timeout: Optional[float] = None,
3107+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
31073108
metadata: Sequence[Tuple[str, str]] = (),
31083109
) -> tags.Tag:
31093110
r"""Creates a tag and assigns it to:
@@ -3244,7 +3245,7 @@ async def update_tag(
32443245
tag: Optional[tags.Tag] = None,
32453246
update_mask: Optional[field_mask_pb2.FieldMask] = None,
32463247
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3247-
timeout: Optional[float] = None,
3248+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
32483249
metadata: Sequence[Tuple[str, str]] = (),
32493250
) -> tags.Tag:
32503251
r"""Updates an existing tag.
@@ -3370,7 +3371,7 @@ async def delete_tag(
33703371
*,
33713372
name: Optional[str] = None,
33723373
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3373-
timeout: Optional[float] = None,
3374+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
33743375
metadata: Sequence[Tuple[str, str]] = (),
33753376
) -> None:
33763377
r"""Deletes a tag.
@@ -3460,7 +3461,7 @@ async def list_tags(
34603461
*,
34613462
parent: Optional[str] = None,
34623463
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3463-
timeout: Optional[float] = None,
3464+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
34643465
metadata: Sequence[Tuple[str, str]] = (),
34653466
) -> pagers.ListTagsAsyncPager:
34663467
r"""Lists tags assigned to an
@@ -3592,7 +3593,7 @@ async def star_entry(
35923593
*,
35933594
name: Optional[str] = None,
35943595
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3595-
timeout: Optional[float] = None,
3596+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
35963597
metadata: Sequence[Tuple[str, str]] = (),
35973598
) -> datacatalog.StarEntryResponse:
35983599
r"""Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred
@@ -3697,7 +3698,7 @@ async def unstar_entry(
36973698
*,
36983699
name: Optional[str] = None,
36993700
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3700-
timeout: Optional[float] = None,
3701+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
37013702
metadata: Sequence[Tuple[str, str]] = (),
37023703
) -> datacatalog.UnstarEntryResponse:
37033704
r"""Marks an [Entry][google.cloud.datacatalog.v1.Entry] as NOT
@@ -3802,7 +3803,7 @@ async def set_iam_policy(
38023803
*,
38033804
resource: Optional[str] = None,
38043805
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3805-
timeout: Optional[float] = None,
3806+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
38063807
metadata: Sequence[Tuple[str, str]] = (),
38073808
) -> policy_pb2.Policy:
38083809
r"""Sets an access control policy for a resource. Replaces any
@@ -3987,7 +3988,7 @@ async def get_iam_policy(
39873988
*,
39883989
resource: Optional[str] = None,
39893990
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3990-
timeout: Optional[float] = None,
3991+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
39913992
metadata: Sequence[Tuple[str, str]] = (),
39923993
) -> policy_pb2.Policy:
39933994
r"""Gets the access control policy for a resource.
@@ -4184,7 +4185,7 @@ async def test_iam_permissions(
41844185
request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None,
41854186
*,
41864187
retry: OptionalRetry = gapic_v1.method.DEFAULT,
4187-
timeout: Optional[float] = None,
4188+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
41884189
metadata: Sequence[Tuple[str, str]] = (),
41894190
) -> iam_policy_pb2.TestIamPermissionsResponse:
41904191
r"""Gets your permissions on a resource.
@@ -4282,14 +4283,9 @@ async def __aexit__(self, exc_type, exc, tb):
42824283
await self.transport.close()
42834284

42844285

4285-
try:
4286-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
4287-
gapic_version=pkg_resources.get_distribution(
4288-
"google-cloud-datacatalog",
4289-
).version,
4290-
)
4291-
except pkg_resources.DistributionNotFound:
4292-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
4286+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
4287+
gapic_version=package_version.__version__
4288+
)
42934289

42944290

42954291
__all__ = ("DataCatalogAsyncClient",)

0 commit comments

Comments
 (0)