Skip to content

Commit

Permalink
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#323)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Dec 6, 2022
1 parent 0da865b commit 5f2738d
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 76 deletions.
5 changes: 0 additions & 5 deletions packages/google-cloud-bigquery-reservation/.coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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.7.3" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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.bigquery_reservation_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -261,7 +262,7 @@ async def create_reservation(
reservation: Optional[gcbr_reservation.Reservation] = None,
reservation_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]] = (),
) -> gcbr_reservation.Reservation:
r"""Creates a new reservation resource.
Expand Down Expand Up @@ -384,7 +385,7 @@ async def list_reservations(
*,
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.ListReservationsAsyncPager:
r"""Lists all the reservations for the project in the
Expand Down Expand Up @@ -510,7 +511,7 @@ async def get_reservation(
*,
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]] = (),
) -> reservation.Reservation:
r"""Returns information about the reservation.
Expand Down Expand Up @@ -623,7 +624,7 @@ async def delete_reservation(
*,
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]] = (),
) -> None:
r"""Deletes a reservation. Returns
Expand Down Expand Up @@ -729,7 +730,7 @@ async def update_reservation(
reservation: Optional[gcbr_reservation.Reservation] = 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]] = (),
) -> gcbr_reservation.Reservation:
r"""Updates an existing reservation resource.
Expand Down Expand Up @@ -842,7 +843,7 @@ async def create_capacity_commitment(
parent: Optional[str] = None,
capacity_commitment: Optional[reservation.CapacityCommitment] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> reservation.CapacityCommitment:
r"""Creates a new capacity commitment resource.
Expand Down Expand Up @@ -967,7 +968,7 @@ async def list_capacity_commitments(
*,
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.ListCapacityCommitmentsAsyncPager:
r"""Lists all the capacity commitments for the admin
Expand Down Expand Up @@ -1093,7 +1094,7 @@ async def get_capacity_commitment(
*,
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]] = (),
) -> reservation.CapacityCommitment:
r"""Returns information about the capacity commitment.
Expand Down Expand Up @@ -1220,7 +1221,7 @@ async def delete_capacity_commitment(
*,
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]] = (),
) -> None:
r"""Deletes a capacity commitment. Attempting to delete capacity
Expand Down Expand Up @@ -1326,7 +1327,7 @@ async def update_capacity_commitment(
capacity_commitment: Optional[reservation.CapacityCommitment] = 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]] = (),
) -> reservation.CapacityCommitment:
r"""Updates an existing capacity commitment.
Expand Down Expand Up @@ -1460,7 +1461,7 @@ async def split_capacity_commitment(
name: Optional[str] = None,
slot_count: Optional[int] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> reservation.SplitCapacityCommitmentResponse:
r"""Splits capacity commitment to two commitments of the same plan
Expand Down Expand Up @@ -1582,7 +1583,7 @@ async def merge_capacity_commitments(
parent: Optional[str] = None,
capacity_commitment_ids: Optional[MutableSequence[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]] = (),
) -> reservation.CapacityCommitment:
r"""Merges capacity commitments of the same plan into a single
Expand Down Expand Up @@ -1719,7 +1720,7 @@ async def create_assignment(
parent: Optional[str] = None,
assignment: Optional[reservation.Assignment] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> reservation.Assignment:
r"""Creates an assignment object which allows the given project to
Expand Down Expand Up @@ -1869,7 +1870,7 @@ async def list_assignments(
*,
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.ListAssignmentsAsyncPager:
r"""Lists assignments.
Expand Down Expand Up @@ -2020,7 +2021,7 @@ async def delete_assignment(
*,
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]] = (),
) -> None:
r"""Deletes a assignment. No expansion will happen.
Expand Down Expand Up @@ -2138,7 +2139,7 @@ async def search_assignments(
parent: Optional[str] = None,
query: 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.SearchAssignmentsAsyncPager:
r"""Deprecated: Looks up assignments for a specified resource for a
Expand Down Expand Up @@ -2310,7 +2311,7 @@ async def search_all_assignments(
parent: Optional[str] = None,
query: 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.SearchAllAssignmentsAsyncPager:
r"""Looks up assignments for a specified resource for a particular
Expand Down Expand Up @@ -2465,7 +2466,7 @@ async def move_assignment(
name: Optional[str] = None,
destination_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]] = (),
) -> reservation.Assignment:
r"""Moves an assignment under a new reservation.
Expand Down Expand Up @@ -2588,7 +2589,7 @@ async def update_assignment(
assignment: Optional[reservation.Assignment] = 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]] = (),
) -> reservation.Assignment:
r"""Updates an existing assignment.
Expand Down Expand Up @@ -2701,7 +2702,7 @@ async def get_bi_reservation(
*,
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]] = (),
) -> reservation.BiReservation:
r"""Retrieves a BI reservation.
Expand Down Expand Up @@ -2813,7 +2814,7 @@ async def update_bi_reservation(
bi_reservation: Optional[reservation.BiReservation] = 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]] = (),
) -> reservation.BiReservation:
r"""Updates a BI reservation.
Expand Down Expand Up @@ -2929,14 +2930,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-bigquery-reservation",
).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__ = ("ReservationServiceAsyncClient",)
Loading

0 comments on commit 5f2738d

Please sign in to comment.