Skip to content

Commit d144a00

Browse files
authored
Docs: fix GAX fossils (googleapis#6264)
* Remove GAX 'CallOptions' fossils from README examples. * Fix out-of-date docstring for 'VisionHelpers.annotate_image'. Remove GAX-style 'options', use explicit 'retry' and 'timeout'. Closes googleapis#5560. (Other elements of that bug will be fixed in 'gapic-generator' (see: googleapis/gapic-generator#2388) and propagated via autosynth.
1 parent 53d8146 commit d144a00

5 files changed

Lines changed: 10 additions & 6 deletions

File tree

bigquery_datatransfer/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ DataTransferServiceClient
8888
pass
8989
9090
# Or iterate over results one page at a time
91-
for page in client.list_data_sources(parent, options=CallOptions(page_token=INITIAL_PAGE)):
91+
for page in client.list_data_sources(parent).pages:
9292
for element in page:
9393
# process element
9494
pass

dataproc/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Example Usage
8787
pass
8888
8989
# Or iterate over results one page at a time
90-
for page in client.list_clusters(project_id, region, options=CallOptions(page_token=INITIAL_PAGE)):
90+
for page in client.list_clusters(project_id, region).pages:
9191
for element in page:
9292
# process element
9393
pass

iot/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ DeviceManagerClient
9090
pass
9191
9292
# Or iterate over results one page at a time
93-
for page in client.list_device_registries(parent, options=CallOptions(page_token=INITIAL_PAGE)):
93+
for page in client.list_device_registries(parent).pages:
9494
for element in page:
9595
# process element
9696
pass

monitoring/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ MetricServiceClient
9090
pass
9191
9292
# Or iterate over results one page at a time
93-
for page in client.list_monitored_resource_descriptors(name, options=CallOptions(page_token=INITIAL_PAGE)):
93+
for page in client.list_monitored_resource_descriptors(name).pages:
9494
for element in page:
9595
# process element
9696
pass

vision/google/cloud/vision_helpers/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ def annotate_image(self, request, retry=None, timeout=None):
4040
4141
Args:
4242
request (:class:`~.vision_v1.types.AnnotateImageRequest`)
43-
options (:class:`google.gax.CallOptions`): Overrides the default
44-
settings for this call, e.g, timeout, retries, etc.
43+
retry (Optional[google.api_core.retry.Retry]): A retry object used
44+
to retry requests. If ``None`` is specified, requests will not
45+
be retried.
46+
timeout (Optional[float]): The amount of time, in seconds, to wait
47+
for the request to complete. Note that if ``retry`` is
48+
specified, the timeout applies to each individual attempt.
4549
4650
Returns:
4751
:class:`~.vision_v1.types.AnnotateImageResponse` The API response.

0 commit comments

Comments
 (0)