Skip to content

Commit fae4ab2

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#53)
* 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 * add gapic_version.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent d2867f6 commit fae4ab2

File tree

9 files changed

+84
-68
lines changed

9 files changed

+84
-68
lines changed

packages/google-cloud-bigquery-data-exchange/.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__ = "0.3.2" # {x-release-please-version}
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__ = "0.3.2" # {x-release-please-version}

packages/google-cloud-bigquery-data-exchange/google/cloud/bigquery_data_exchange_v1beta1/services/analytics_hub_service/async_client.py

Lines changed: 22 additions & 26 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.bigquery_data_exchange_v1beta1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -240,7 +241,7 @@ async def list_data_exchanges(
240241
*,
241242
parent: Optional[str] = None,
242243
retry: OptionalRetry = gapic_v1.method.DEFAULT,
243-
timeout: Optional[float] = None,
244+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
244245
metadata: Sequence[Tuple[str, str]] = (),
245246
) -> pagers.ListDataExchangesAsyncPager:
246247
r"""Lists all data exchanges in a given project and
@@ -356,7 +357,7 @@ async def list_org_data_exchanges(
356357
*,
357358
organization: Optional[str] = None,
358359
retry: OptionalRetry = gapic_v1.method.DEFAULT,
359-
timeout: Optional[float] = None,
360+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
360361
metadata: Sequence[Tuple[str, str]] = (),
361362
) -> pagers.ListOrgDataExchangesAsyncPager:
362363
r"""Lists all data exchanges from projects in a given
@@ -477,7 +478,7 @@ async def get_data_exchange(
477478
*,
478479
name: 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
) -> dataexchange.DataExchange:
483484
r"""Gets the details of a data exchange.
@@ -582,7 +583,7 @@ async def create_data_exchange(
582583
parent: Optional[str] = None,
583584
data_exchange: Optional[dataexchange.DataExchange] = None,
584585
retry: OptionalRetry = gapic_v1.method.DEFAULT,
585-
timeout: Optional[float] = None,
586+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
586587
metadata: Sequence[Tuple[str, str]] = (),
587588
) -> dataexchange.DataExchange:
588589
r"""Creates a new data exchange.
@@ -702,7 +703,7 @@ async def update_data_exchange(
702703
data_exchange: Optional[dataexchange.DataExchange] = None,
703704
update_mask: Optional[field_mask_pb2.FieldMask] = None,
704705
retry: OptionalRetry = gapic_v1.method.DEFAULT,
705-
timeout: Optional[float] = None,
706+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
706707
metadata: Sequence[Tuple[str, str]] = (),
707708
) -> dataexchange.DataExchange:
708709
r"""Updates an existing data exchange.
@@ -823,7 +824,7 @@ async def delete_data_exchange(
823824
*,
824825
name: Optional[str] = None,
825826
retry: OptionalRetry = gapic_v1.method.DEFAULT,
826-
timeout: Optional[float] = None,
827+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
827828
metadata: Sequence[Tuple[str, str]] = (),
828829
) -> None:
829830
r"""Deletes an existing data exchange.
@@ -914,7 +915,7 @@ async def list_listings(
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.ListListingsAsyncPager:
920921
r"""Lists all listings in a given project and location.
@@ -1029,7 +1030,7 @@ async def get_listing(
10291030
*,
10301031
name: Optional[str] = None,
10311032
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1032-
timeout: Optional[float] = None,
1033+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10331034
metadata: Sequence[Tuple[str, str]] = (),
10341035
) -> dataexchange.Listing:
10351036
r"""Gets the details of a listing.
@@ -1135,7 +1136,7 @@ async def create_listing(
11351136
parent: Optional[str] = None,
11361137
listing: Optional[dataexchange.Listing] = None,
11371138
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1138-
timeout: Optional[float] = None,
1139+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11391140
metadata: Sequence[Tuple[str, str]] = (),
11401141
) -> dataexchange.Listing:
11411142
r"""Creates a new listing.
@@ -1253,7 +1254,7 @@ async def update_listing(
12531254
listing: Optional[dataexchange.Listing] = None,
12541255
update_mask: Optional[field_mask_pb2.FieldMask] = None,
12551256
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1256-
timeout: Optional[float] = None,
1257+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12571258
metadata: Sequence[Tuple[str, str]] = (),
12581259
) -> dataexchange.Listing:
12591260
r"""Updates an existing listing.
@@ -1372,7 +1373,7 @@ async def delete_listing(
13721373
*,
13731374
name: Optional[str] = None,
13741375
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1375-
timeout: Optional[float] = None,
1376+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13761377
metadata: Sequence[Tuple[str, str]] = (),
13771378
) -> None:
13781379
r"""Deletes a listing.
@@ -1461,7 +1462,7 @@ async def subscribe_listing(
14611462
*,
14621463
name: Optional[str] = None,
14631464
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1464-
timeout: Optional[float] = None,
1465+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14651466
metadata: Sequence[Tuple[str, str]] = (),
14661467
) -> dataexchange.SubscribeListingResponse:
14671468
r"""Subscribes to a listing.
@@ -1574,7 +1575,7 @@ async def get_iam_policy(
15741575
request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None,
15751576
*,
15761577
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1577-
timeout: Optional[float] = None,
1578+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15781579
metadata: Sequence[Tuple[str, str]] = (),
15791580
) -> policy_pb2.Policy:
15801581
r"""Gets the IAM policy.
@@ -1717,7 +1718,7 @@ async def set_iam_policy(
17171718
request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None,
17181719
*,
17191720
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1720-
timeout: Optional[float] = None,
1721+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17211722
metadata: Sequence[Tuple[str, str]] = (),
17221723
) -> policy_pb2.Policy:
17231724
r"""Sets the IAM policy.
@@ -1860,7 +1861,7 @@ async def test_iam_permissions(
18601861
request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None,
18611862
*,
18621863
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1863-
timeout: Optional[float] = None,
1864+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18641865
metadata: Sequence[Tuple[str, str]] = (),
18651866
) -> iam_policy_pb2.TestIamPermissionsResponse:
18661867
r"""Returns the permissions that a caller has.
@@ -1943,7 +1944,7 @@ async def get_location(
19431944
request: Optional[locations_pb2.GetLocationRequest] = None,
19441945
*,
19451946
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1946-
timeout: Optional[float] = None,
1947+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
19471948
metadata: Sequence[Tuple[str, str]] = (),
19481949
) -> locations_pb2.Location:
19491950
r"""Gets information about a location.
@@ -1997,7 +1998,7 @@ async def list_locations(
19971998
request: Optional[locations_pb2.ListLocationsRequest] = None,
19981999
*,
19992000
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2000-
timeout: Optional[float] = None,
2001+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
20012002
metadata: Sequence[Tuple[str, str]] = (),
20022003
) -> locations_pb2.ListLocationsResponse:
20032004
r"""Lists information about the supported locations for this service.
@@ -2053,14 +2054,9 @@ async def __aexit__(self, exc_type, exc, tb):
20532054
await self.transport.close()
20542055

20552056

2056-
try:
2057-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
2058-
gapic_version=pkg_resources.get_distribution(
2059-
"google-cloud-bigquery-data-exchange",
2060-
).version,
2061-
)
2062-
except pkg_resources.DistributionNotFound:
2063-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
2057+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
2058+
gapic_version=package_version.__version__
2059+
)
20642060

20652061

20662062
__all__ = ("AnalyticsHubServiceAsyncClient",)

0 commit comments

Comments
 (0)