Skip to content

Commit

Permalink
Docs: fix GAX fossils (#6264)
Browse files Browse the repository at this point in the history
* 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 #5560.  (Other elements of that bug will be fixed in 'gapic-generator'
(see: googleapis/gapic-generator#2388) and
propagated via autosynth.
  • Loading branch information
tseaver authored Oct 24, 2018
1 parent 53d8146 commit d144a00
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bigquery_datatransfer/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ DataTransferServiceClient
pass
# Or iterate over results one page at a time
for page in client.list_data_sources(parent, options=CallOptions(page_token=INITIAL_PAGE)):
for page in client.list_data_sources(parent).pages:
for element in page:
# process element
pass
Expand Down
2 changes: 1 addition & 1 deletion dataproc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Example Usage
pass
# Or iterate over results one page at a time
for page in client.list_clusters(project_id, region, options=CallOptions(page_token=INITIAL_PAGE)):
for page in client.list_clusters(project_id, region).pages:
for element in page:
# process element
pass
Expand Down
2 changes: 1 addition & 1 deletion iot/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ DeviceManagerClient
pass
# Or iterate over results one page at a time
for page in client.list_device_registries(parent, options=CallOptions(page_token=INITIAL_PAGE)):
for page in client.list_device_registries(parent).pages:
for element in page:
# process element
pass
Expand Down
2 changes: 1 addition & 1 deletion monitoring/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ MetricServiceClient
pass
# Or iterate over results one page at a time
for page in client.list_monitored_resource_descriptors(name, options=CallOptions(page_token=INITIAL_PAGE)):
for page in client.list_monitored_resource_descriptors(name).pages:
for element in page:
# process element
pass
Expand Down
8 changes: 6 additions & 2 deletions vision/google/cloud/vision_helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ def annotate_image(self, request, retry=None, timeout=None):
Args:
request (:class:`~.vision_v1.types.AnnotateImageRequest`)
options (:class:`google.gax.CallOptions`): Overrides the default
settings for this call, e.g, timeout, retries, etc.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
Returns:
:class:`~.vision_v1.types.AnnotateImageResponse` The API response.
Expand Down

0 comments on commit d144a00

Please sign in to comment.