1717# This file is automatically generated by CrossSync. Do not edit manually.
1818
1919from __future__ import annotations
20-
2120import abc
2221import concurrent .futures
2322import os
2423import random
2524import time
2625import warnings
2726from functools import partial
28- from typing import TYPE_CHECKING , Any , Callable , Iterable , Optional , Sequence , Set , cast
29-
27+ from typing import TYPE_CHECKING , Any , Callable , Optional , Sequence , Set , cast
3028import google .auth ._default
3129import google .auth .credentials
3230from google .api_core import client_options as client_options_lib
4139from google .cloud .environment_vars import BIGTABLE_EMULATOR
4240from google .protobuf .internal .enum_type_wrapper import EnumTypeWrapper
4341from google .protobuf .message import Message
44- from grpc import Channel , insecure_channel , intercept_channel
45-
42+ from grpc import Channel
4643from google .cloud .bigtable .client import _DEFAULT_BIGTABLE_EMULATOR_CLIENT
4744from google .cloud .bigtable .data ._cross_sync import CrossSync
4845from google .cloud .bigtable .data ._helpers import (
5855 _WarmedInstanceKey ,
5956)
6057from google .cloud .bigtable .data ._metrics import BigtableClientSideMetricsController
61- from google .cloud .bigtable .data ._sync_autogen ._swappable_channel import (
62- SwappableChannel as SwappableChannelType ,
63- )
64- from google .cloud .bigtable .data ._sync_autogen .metrics_interceptor import (
65- BigtableMetricsInterceptor as MetricsInterceptorType ,
66- )
67- from google .cloud .bigtable .data ._sync_autogen .mutations_batcher import _MB_SIZE
6858from google .cloud .bigtable .data .exceptions import (
6959 FailedQueryShardError ,
7060 ShardedReadRowsExceptionGroup ,
8878 RowFilterChain ,
8979 StripValueTransformerFilter ,
9080)
91- from google .cloud .bigtable_v2 .services .bigtable import BigtableClient as GapicClient
92- from google .cloud .bigtable_v2 .services .bigtable .transports import (
93- BigtableGrpcTransport as TransportType ,
94- )
9581from google .cloud .bigtable_v2 .services .bigtable .transports .base import (
9682 DEFAULT_CLIENT_INFO ,
9783)
10288 ReadModifyWriteRowRequest ,
10389 SampleRowKeysRequest ,
10490)
91+ from typing import Iterable
92+ from grpc import insecure_channel , intercept_channel
93+ from google .cloud .bigtable .data ._sync_autogen ._swappable_channel import (
94+ SwappableChannel as SwappableChannelType ,
95+ )
96+ from google .cloud .bigtable .data ._sync_autogen .metrics_interceptor import (
97+ BigtableMetricsInterceptor as MetricsInterceptorType ,
98+ )
99+ from google .cloud .bigtable .data ._sync_autogen .mutations_batcher import _MB_SIZE
100+ from google .cloud .bigtable_v2 .services .bigtable import BigtableClient as GapicClient
101+ from google .cloud .bigtable_v2 .services .bigtable .transports import (
102+ BigtableGrpcTransport as TransportType ,
103+ )
105104
106105if TYPE_CHECKING :
107106 from google .cloud .bigtable .data ._helpers import RowKeySamples , ShardedQuery
@@ -320,7 +319,7 @@ def _ping_and_warm_instances(
320319 ],
321320 wait_for_ready = True ,
322321 )
323- for ( instance_name , app_profile_id ) in instance_list
322+ for instance_name , app_profile_id in instance_list
324323 ]
325324 result_list = CrossSync ._Sync_Impl .gather_partials (
326325 partial_list , return_exceptions = True , sync_executor = self ._executor
@@ -669,7 +668,7 @@ def execute_query(
669668 prepare_predicate = retries .if_exception_type (
670669 * [_get_error_type (e ) for e in prepare_retryable_errors ]
671670 )
672- ( prepare_operation_timeout , prepare_attempt_timeout ) = _align_timeouts (
671+ prepare_operation_timeout , prepare_attempt_timeout = _align_timeouts (
673672 prepare_operation_timeout , prepare_attempt_timeout
674673 )
675674 prepare_sleep_generator = retries .exponential_sleep_generator (0.01 , 2 , 60 )
@@ -695,7 +694,7 @@ def execute_query(
695694 "prepared_query" : prepare_result .prepared_query ,
696695 "params" : pb_params ,
697696 }
698- ( operation_timeout , attempt_timeout ) = _align_timeouts (
697+ operation_timeout , attempt_timeout = _align_timeouts (
699698 operation_timeout , attempt_timeout
700699 )
701700 return CrossSync ._Sync_Impl .ExecuteQueryIterator (
@@ -896,7 +895,7 @@ def read_rows_stream(
896895 from any retries that failed
897896 google.api_core.exceptions.GoogleAPIError: raised if the request encounters an unrecoverable error
898897 """
899- ( operation_timeout , attempt_timeout ) = _get_timeouts (
898+ operation_timeout , attempt_timeout = _get_timeouts (
900899 operation_timeout , attempt_timeout , self
901900 )
902901 retryable_excs = _get_retryable_errors (retryable_errors , self )
@@ -1042,7 +1041,7 @@ def read_rows_sharded(
10421041 ValueError: if the query_list is empty"""
10431042 if not sharded_query :
10441043 raise ValueError ("empty sharded_query" )
1045- ( operation_timeout , attempt_timeout ) = _get_timeouts (
1044+ operation_timeout , attempt_timeout = _get_timeouts (
10461045 operation_timeout , attempt_timeout , self
10471046 )
10481047 rpc_timeout_generator = _attempt_timeout_generator (
@@ -1085,7 +1084,7 @@ def read_rows_with_semaphore(query):
10851084 raise ShardedReadRowsExceptionGroup (
10861085 [
10871086 FailedQueryShardError (idx , sharded_query [idx ], e )
1088- for ( idx , e ) in error_dict .items ()
1087+ for idx , e in error_dict .items ()
10891088 ],
10901089 results_list ,
10911090 len (sharded_query ),
@@ -1175,7 +1174,7 @@ def sample_row_keys(
11751174 from any retries that failed
11761175 google.api_core.exceptions.GoogleAPIError: raised if the request encounters an unrecoverable error
11771176 """
1178- ( operation_timeout , attempt_timeout ) = _get_timeouts (
1177+ operation_timeout , attempt_timeout = _get_timeouts (
11791178 operation_timeout , attempt_timeout , self
11801179 )
11811180 attempt_timeout_gen = _attempt_timeout_generator (
@@ -1290,7 +1289,7 @@ def mutate_row(
12901289 google.api_core.exceptions.GoogleAPIError: raised on non-idempotent operations that cannot be
12911290 safely retried.
12921291 ValueError: if invalid arguments are provided"""
1293- ( operation_timeout , attempt_timeout ) = _get_timeouts (
1292+ operation_timeout , attempt_timeout = _get_timeouts (
12941293 operation_timeout , attempt_timeout , self
12951294 )
12961295 if not mutations :
@@ -1362,7 +1361,7 @@ def bulk_mutate_rows(
13621361 MutationsExceptionGroup: if one or more mutations fails
13631362 Contains details about any failed entries in .exceptions
13641363 ValueError: if invalid arguments are provided"""
1365- ( operation_timeout , attempt_timeout ) = _get_timeouts (
1364+ operation_timeout , attempt_timeout = _get_timeouts (
13661365 operation_timeout , attempt_timeout , self
13671366 )
13681367 retryable_excs = _get_retryable_errors (retryable_errors , self )
@@ -1415,7 +1414,7 @@ def check_and_mutate_row(
14151414 bool indicating whether the predicate was true or false
14161415 Raises:
14171416 google.api_core.exceptions.GoogleAPIError: exceptions from grpc call"""
1418- ( operation_timeout , _ ) = _get_timeouts (operation_timeout , None , self )
1417+ operation_timeout , _ = _get_timeouts (operation_timeout , None , self )
14191418 if true_case_mutations is not None and (
14201419 not isinstance (true_case_mutations , list )
14211420 ):
@@ -1470,7 +1469,7 @@ def read_modify_write_row(
14701469 Raises:
14711470 google.api_core.exceptions.GoogleAPIError: exceptions from grpc call
14721471 ValueError: if invalid arguments are provided"""
1473- ( operation_timeout , _ ) = _get_timeouts (operation_timeout , None , self )
1472+ operation_timeout , _ = _get_timeouts (operation_timeout , None , self )
14741473 if operation_timeout <= 0 :
14751474 raise ValueError ("operation_timeout must be greater than 0" )
14761475 if rules is not None and (not isinstance (rules , list )):
0 commit comments