Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Commit 4e18437

Browse files
fix: use retry_async instead of retry in async client (#713)
* chore: Update gapic-generator-python to v1.12.0 PiperOrigin-RevId: 586356061 Source-Link: googleapis/googleapis@72a1f55 Source-Link: googleapis/googleapis-gen@558a04b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU4YTA0YmNkMWNjMDU3NmU4ZmFjMTA4OWU0OGU0OGIyN2FjMTYxYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: added Generator API docs: updated doc for speech mode PiperOrigin-RevId: 586469693 Source-Link: googleapis/googleapis@e8148d6 Source-Link: googleapis/googleapis-gen@85136bd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODUxMzZiZDA0MzgzZWQ3MTcyYmIxOGI3YjhkMjIwZGQ3ZmY2YjNhMCJ9 * 🦉 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: Lingqing Gan <lingqing.gan@gmail.com>
1 parent 4ab9b95 commit 4e18437

File tree

6 files changed

+50
-50
lines changed

6 files changed

+50
-50
lines changed

google/cloud/bigquery_storage_v1/services/big_query_read/async_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
from google.api_core.client_options import ClientOptions
3636
from google.api_core import exceptions as core_exceptions
3737
from google.api_core import gapic_v1
38-
from google.api_core import retry as retries
38+
from google.api_core import retry_async as retries
3939
from google.auth import credentials as ga_credentials # type: ignore
4040
from google.oauth2 import service_account # type: ignore
4141

4242
try:
43-
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
43+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault]
4444
except AttributeError: # pragma: NO COVER
45-
OptionalRetry = Union[retries.Retry, object] # type: ignore
45+
OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore
4646

4747
from google.cloud.bigquery_storage_v1.types import arrow
4848
from google.cloud.bigquery_storage_v1.types import avro
@@ -315,7 +315,7 @@ async def sample_create_read_session():
315315
This corresponds to the ``max_stream_count`` field
316316
on the ``request`` instance; if ``request`` is provided, this
317317
should not be set.
318-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
318+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
319319
should be retried.
320320
timeout (float): The timeout for this request.
321321
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -350,7 +350,7 @@ async def sample_create_read_session():
350350
# and friendly error handling.
351351
rpc = gapic_v1.method_async.wrap_method(
352352
self._client._transport.create_read_session,
353-
default_retry=retries.Retry(
353+
default_retry=retries.AsyncRetry(
354354
initial=0.1,
355355
maximum=60.0,
356356
multiplier=1.3,
@@ -447,7 +447,7 @@ async def sample_read_rows():
447447
This corresponds to the ``offset`` field
448448
on the ``request`` instance; if ``request`` is provided, this
449449
should not be set.
450-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
450+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
451451
should be retried.
452452
timeout (float): The timeout for this request.
453453
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -482,7 +482,7 @@ async def sample_read_rows():
482482
# and friendly error handling.
483483
rpc = gapic_v1.method_async.wrap_method(
484484
self._client._transport.read_rows,
485-
default_retry=retries.Retry(
485+
default_retry=retries.AsyncRetry(
486486
initial=0.1,
487487
maximum=60.0,
488488
multiplier=1.3,
@@ -565,7 +565,7 @@ async def sample_split_read_stream():
565565
Args:
566566
request (Optional[Union[google.cloud.bigquery_storage_v1.types.SplitReadStreamRequest, dict]]):
567567
The request object. Request message for ``SplitReadStream``.
568-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
568+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
569569
should be retried.
570570
timeout (float): The timeout for this request.
571571
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -582,7 +582,7 @@ async def sample_split_read_stream():
582582
# and friendly error handling.
583583
rpc = gapic_v1.method_async.wrap_method(
584584
self._client._transport.split_read_stream,
585-
default_retry=retries.Retry(
585+
default_retry=retries.AsyncRetry(
586586
initial=0.1,
587587
maximum=60.0,
588588
multiplier=1.3,

google/cloud/bigquery_storage_v1/services/big_query_write/async_client.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
from google.api_core.client_options import ClientOptions
3737
from google.api_core import exceptions as core_exceptions
3838
from google.api_core import gapic_v1
39-
from google.api_core import retry as retries
39+
from google.api_core import retry_async as retries
4040
from google.auth import credentials as ga_credentials # type: ignore
4141
from google.oauth2 import service_account # type: ignore
4242

4343
try:
44-
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
44+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault]
4545
except AttributeError: # pragma: NO COVER
46-
OptionalRetry = Union[retries.Retry, object] # type: ignore
46+
OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore
4747

4848
from google.cloud.bigquery_storage_v1.types import storage
4949
from google.cloud.bigquery_storage_v1.types import stream
@@ -288,7 +288,7 @@ async def sample_create_write_stream():
288288
This corresponds to the ``write_stream`` field
289289
on the ``request`` instance; if ``request`` is provided, this
290290
should not be set.
291-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
291+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
292292
should be retried.
293293
timeout (float): The timeout for this request.
294294
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -324,7 +324,7 @@ async def sample_create_write_stream():
324324
# and friendly error handling.
325325
rpc = gapic_v1.method_async.wrap_method(
326326
self._client._transport.create_write_stream,
327-
default_retry=retries.Retry(
327+
default_retry=retries.AsyncRetry(
328328
initial=10.0,
329329
maximum=120.0,
330330
multiplier=1.3,
@@ -449,7 +449,7 @@ def request_generator():
449449
The size of a single AppendRowsRequest must be less than
450450
10 MB in size. Requests larger than this return an
451451
error, typically ``INVALID_ARGUMENT``.
452-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
452+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
453453
should be retried.
454454
timeout (float): The timeout for this request.
455455
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -464,7 +464,7 @@ def request_generator():
464464
# and friendly error handling.
465465
rpc = gapic_v1.method_async.wrap_method(
466466
self._client._transport.append_rows,
467-
default_retry=retries.Retry(
467+
default_retry=retries.AsyncRetry(
468468
initial=0.1,
469469
maximum=60.0,
470470
multiplier=1.3,
@@ -539,7 +539,7 @@ async def sample_get_write_stream():
539539
This corresponds to the ``name`` field
540540
on the ``request`` instance; if ``request`` is provided, this
541541
should not be set.
542-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
542+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
543543
should be retried.
544544
timeout (float): The timeout for this request.
545545
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -573,7 +573,7 @@ async def sample_get_write_stream():
573573
# and friendly error handling.
574574
rpc = gapic_v1.method_async.wrap_method(
575575
self._client._transport.get_write_stream,
576-
default_retry=retries.Retry(
576+
default_retry=retries.AsyncRetry(
577577
initial=0.1,
578578
maximum=60.0,
579579
multiplier=1.3,
@@ -653,7 +653,7 @@ async def sample_finalize_write_stream():
653653
This corresponds to the ``name`` field
654654
on the ``request`` instance; if ``request`` is provided, this
655655
should not be set.
656-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
656+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
657657
should be retried.
658658
timeout (float): The timeout for this request.
659659
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -684,7 +684,7 @@ async def sample_finalize_write_stream():
684684
# and friendly error handling.
685685
rpc = gapic_v1.method_async.wrap_method(
686686
self._client._transport.finalize_write_stream,
687-
default_retry=retries.Retry(
687+
default_retry=retries.AsyncRetry(
688688
initial=0.1,
689689
maximum=60.0,
690690
multiplier=1.3,
@@ -770,7 +770,7 @@ async def sample_batch_commit_write_streams():
770770
This corresponds to the ``parent`` field
771771
on the ``request`` instance; if ``request`` is provided, this
772772
should not be set.
773-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
773+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
774774
should be retried.
775775
timeout (float): The timeout for this request.
776776
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -801,7 +801,7 @@ async def sample_batch_commit_write_streams():
801801
# and friendly error handling.
802802
rpc = gapic_v1.method_async.wrap_method(
803803
self._client._transport.batch_commit_write_streams,
804-
default_retry=retries.Retry(
804+
default_retry=retries.AsyncRetry(
805805
initial=0.1,
806806
maximum=60.0,
807807
multiplier=1.3,
@@ -889,7 +889,7 @@ async def sample_flush_rows():
889889
This corresponds to the ``write_stream`` field
890890
on the ``request`` instance; if ``request`` is provided, this
891891
should not be set.
892-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
892+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
893893
should be retried.
894894
timeout (float): The timeout for this request.
895895
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -920,7 +920,7 @@ async def sample_flush_rows():
920920
# and friendly error handling.
921921
rpc = gapic_v1.method_async.wrap_method(
922922
self._client._transport.flush_rows,
923-
default_retry=retries.Retry(
923+
default_retry=retries.AsyncRetry(
924924
initial=0.1,
925925
maximum=60.0,
926926
multiplier=1.3,

google/cloud/bigquery_storage_v1beta2/services/big_query_read/async_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
from google.api_core.client_options import ClientOptions
3636
from google.api_core import exceptions as core_exceptions
3737
from google.api_core import gapic_v1
38-
from google.api_core import retry as retries
38+
from google.api_core import retry_async as retries
3939
from google.auth import credentials as ga_credentials # type: ignore
4040
from google.oauth2 import service_account # type: ignore
4141

4242
try:
43-
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
43+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault]
4444
except AttributeError: # pragma: NO COVER
45-
OptionalRetry = Union[retries.Retry, object] # type: ignore
45+
OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore
4646

4747
from google.cloud.bigquery_storage_v1beta2.types import arrow
4848
from google.cloud.bigquery_storage_v1beta2.types import avro
@@ -319,7 +319,7 @@ async def sample_create_read_session():
319319
This corresponds to the ``max_stream_count`` field
320320
on the ``request`` instance; if ``request`` is provided, this
321321
should not be set.
322-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
322+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
323323
should be retried.
324324
timeout (float): The timeout for this request.
325325
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -354,7 +354,7 @@ async def sample_create_read_session():
354354
# and friendly error handling.
355355
rpc = gapic_v1.method_async.wrap_method(
356356
self._client._transport.create_read_session,
357-
default_retry=retries.Retry(
357+
default_retry=retries.AsyncRetry(
358358
initial=0.1,
359359
maximum=60.0,
360360
multiplier=1.3,
@@ -451,7 +451,7 @@ async def sample_read_rows():
451451
This corresponds to the ``offset`` field
452452
on the ``request`` instance; if ``request`` is provided, this
453453
should not be set.
454-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
454+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
455455
should be retried.
456456
timeout (float): The timeout for this request.
457457
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -486,7 +486,7 @@ async def sample_read_rows():
486486
# and friendly error handling.
487487
rpc = gapic_v1.method_async.wrap_method(
488488
self._client._transport.read_rows,
489-
default_retry=retries.Retry(
489+
default_retry=retries.AsyncRetry(
490490
initial=0.1,
491491
maximum=60.0,
492492
multiplier=1.3,
@@ -569,7 +569,7 @@ async def sample_split_read_stream():
569569
Args:
570570
request (Optional[Union[google.cloud.bigquery_storage_v1beta2.types.SplitReadStreamRequest, dict]]):
571571
The request object. Request message for ``SplitReadStream``.
572-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
572+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
573573
should be retried.
574574
timeout (float): The timeout for this request.
575575
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -586,7 +586,7 @@ async def sample_split_read_stream():
586586
# and friendly error handling.
587587
rpc = gapic_v1.method_async.wrap_method(
588588
self._client._transport.split_read_stream,
589-
default_retry=retries.Retry(
589+
default_retry=retries.AsyncRetry(
590590
initial=0.1,
591591
maximum=60.0,
592592
multiplier=1.3,

0 commit comments

Comments
 (0)