110110 from google .cloud .bigtable .data ._helpers import ShardedQuery
111111
112112
113- @CrossSync .export_sync (
114- path = "google.cloud.bigtable.data._sync.client.BigtableDataClient" ,
115- )
116113class BigtableDataClientAsync (ClientWithProject ):
117- @CrossSync .convert (
118- replace_symbols = {
119- "BigtableAsyncClient" : "BigtableClient" ,
120- "PooledBigtableGrpcAsyncIOTransport" : "PooledBigtableGrpcTransport" ,
121- "AsyncPooledChannel" : "PooledChannel" ,
122- }
123- )
124114 def __init__ (
125115 self ,
126116 * ,
@@ -266,7 +256,6 @@ def _start_background_channel_refresh(self) -> None:
266256 lambda _ : self ._channel_refresh_tasks .remove (refresh_task ) if refresh_task in self ._channel_refresh_tasks else None
267257 )
268258
269- @CrossSync .convert
270259 async def close (self , timeout : float | None = None ):
271260 """
272261 Cancel all background tasks
@@ -279,7 +268,6 @@ async def close(self, timeout: float | None = None):
279268 self ._executor .shutdown (wait = False )
280269 await CrossSync .wait (self ._channel_refresh_tasks , timeout = timeout )
281270
282- @CrossSync .convert
283271 async def _ping_and_warm_instances (
284272 self , channel : Channel , instance_key : _helpers ._WarmedInstanceKey | None = None
285273 ) -> list [BaseException | None ]:
@@ -321,7 +309,6 @@ async def _ping_and_warm_instances(
321309 )
322310 return [r or None for r in result_list ]
323311
324- @CrossSync .convert
325312 async def _manage_channel (
326313 self ,
327314 channel_idx : int ,
@@ -378,7 +365,6 @@ async def _manage_channel(
378365 next_refresh = random .uniform (refresh_interval_min , refresh_interval_max )
379366 next_sleep = next_refresh - (time .monotonic () - start_timestamp )
380367
381- @CrossSync .convert (replace_symbols = {"TableAsync" : "Table" })
382368 async def _register_instance (self , instance_id : str , owner : TableAsync ) -> None :
383369 """
384370 Registers an instance with the client, and warms the channel pool
@@ -409,7 +395,6 @@ async def _register_instance(self, instance_id: str, owner: TableAsync) -> None:
409395 # refresh tasks aren't active. start them as background tasks
410396 self ._start_background_channel_refresh ()
411397
412- @CrossSync .convert (replace_symbols = {"TableAsync" : "Table" })
413398 async def _remove_instance_registration (
414399 self , instance_id : str , owner : TableAsync
415400 ) -> bool :
@@ -440,7 +425,6 @@ async def _remove_instance_registration(
440425 except KeyError :
441426 return False
442427
443- @CrossSync .convert (replace_symbols = {"TableAsync" : "Table" })
444428 def get_table (self , instance_id : str , table_id : str , * args , ** kwargs ) -> TableAsync :
445429 """
446430 Returns a table instance for making data API requests. All arguments are passed
@@ -482,18 +466,15 @@ def get_table(self, instance_id: str, table_id: str, *args, **kwargs) -> TableAs
482466 """
483467 return TableAsync (self , instance_id , table_id , * args , ** kwargs )
484468
485- @CrossSync .convert (sync_name = "__enter__" )
486469 async def __aenter__ (self ):
487470 self ._start_background_channel_refresh ()
488471 return self
489472
490- @CrossSync .convert (sync_name = "__exit__" , replace_symbols = {"__aexit__" : "__exit__" })
491473 async def __aexit__ (self , exc_type , exc_val , exc_tb ):
492474 await self .close ()
493475 await self ._gapic_client .__aexit__ (exc_type , exc_val , exc_tb )
494476
495477
496- @CrossSync .export_sync (path = "google.cloud.bigtable.data._sync.client.Table" )
497478class TableAsync :
498479 """
499480 Main Data API surface
@@ -502,9 +483,6 @@ class TableAsync:
502483 each call
503484 """
504485
505- @CrossSync .convert (
506- replace_symbols = {"BigtableDataClientAsync" : "BigtableDataClient" }
507- )
508486 def __init__ (
509487 self ,
510488 client : BigtableDataClientAsync ,
@@ -625,12 +603,6 @@ def __init__(
625603 f"{ self .__class__ .__name__ } must be created within an async event loop context."
626604 ) from e
627605
628- @CrossSync .convert (
629- replace_symbols = {
630- "AsyncIterable" : "Iterable" ,
631- "_ReadRowsOperationAsync" : "_ReadRowsOperation" ,
632- }
633- )
634606 async def read_rows_stream (
635607 self ,
636608 query : ReadRowsQuery ,
@@ -681,7 +653,6 @@ async def read_rows_stream(
681653 )
682654 return row_merger .start_operation ()
683655
684- @CrossSync .convert
685656 async def read_rows (
686657 self ,
687658 query : ReadRowsQuery ,
@@ -729,7 +700,6 @@ async def read_rows(
729700 )
730701 return [row async for row in row_generator ]
731702
732- @CrossSync .convert
733703 async def read_row (
734704 self ,
735705 row_key : str | bytes ,
@@ -779,7 +749,6 @@ async def read_row(
779749 return None
780750 return results [0 ]
781751
782- @CrossSync .convert
783752 async def read_rows_sharded (
784753 self ,
785754 sharded_query : ShardedQuery ,
@@ -879,7 +848,6 @@ async def read_rows_with_semaphore(query):
879848 )
880849 return results_list
881850
882- @CrossSync .convert
883851 async def row_exists (
884852 self ,
885853 row_key : str | bytes ,
@@ -928,7 +896,6 @@ async def row_exists(
928896 )
929897 return len (results ) > 0
930898
931- @CrossSync .convert
932899 async def sample_row_keys (
933900 self ,
934901 * ,
@@ -1001,7 +968,6 @@ async def execute_rpc():
1001968 exception_factory = _helpers ._retry_exception_factory ,
1002969 )
1003970
1004- @CrossSync .convert (replace_symbols = {"MutationsBatcherAsync" : "MutationsBatcher" })
1005971 def mutations_batcher (
1006972 self ,
1007973 * ,
@@ -1051,7 +1017,6 @@ def mutations_batcher(
10511017 batch_retryable_errors = batch_retryable_errors ,
10521018 )
10531019
1054- @CrossSync .convert
10551020 async def mutate_row (
10561021 self ,
10571022 row_key : str | bytes ,
@@ -1130,9 +1095,6 @@ async def mutate_row(
11301095 exception_factory = _helpers ._retry_exception_factory ,
11311096 )
11321097
1133- @CrossSync .convert (
1134- replace_symbols = {"_MutateRowsOperationAsync" : "_MutateRowsOperation" }
1135- )
11361098 async def bulk_mutate_rows (
11371099 self ,
11381100 mutation_entries : list [RowMutationEntry ],
@@ -1188,7 +1150,6 @@ async def bulk_mutate_rows(
11881150 )
11891151 await operation .start ()
11901152
1191- @CrossSync .convert
11921153 async def check_and_mutate_row (
11931154 self ,
11941155 row_key : str | bytes ,
@@ -1255,7 +1216,6 @@ async def check_and_mutate_row(
12551216 )
12561217 return result .predicate_matched
12571218
1258- @CrossSync .convert
12591219 async def read_modify_write_row (
12601220 self ,
12611221 row_key : str | bytes ,
@@ -1306,7 +1266,6 @@ async def read_modify_write_row(
13061266 # construct Row from result
13071267 return Row ._from_pb (result .row )
13081268
1309- @CrossSync .convert
13101269 async def close (self ):
13111270 """
13121271 Called to close the Table instance and release any resources held by it.
@@ -1315,7 +1274,6 @@ async def close(self):
13151274 self ._register_instance_future .cancel ()
13161275 await self .client ._remove_instance_registration (self .instance_id , self )
13171276
1318- @CrossSync .convert (sync_name = "__enter__" )
13191277 async def __aenter__ (self ):
13201278 """
13211279 Implement async context manager protocol
@@ -1327,7 +1285,6 @@ async def __aenter__(self):
13271285 await self ._register_instance_future
13281286 return self
13291287
1330- @CrossSync .convert (sync_name = "__exit__" )
13311288 async def __aexit__ (self , exc_type , exc_val , exc_tb ):
13321289 """
13331290 Implement async context manager protocol
0 commit comments