Skip to content

Commit

Permalink
Move google.cloud.iterator to google.api.core.page_iterator (#3770)
Browse files Browse the repository at this point in the history
* Move google.cloud.iterator to google.api.core.page_iterator
* Re-write tests to pytest style.
* Make GAXIterator private- it will soon be removed.
* Pass api_request into HTTPIterator to avoid accessing private members
* BigQuery: use google.api.core.page_iterator
* DNS: use google.api.core.page_iterator
* Logging: use google.api.core.page_iterator
* PubSub: use google.api.core.page_iterator
* Resource manager: use google.api.core.page_iterator
* Runtimeconfig: use google.api.core.page_iterator
* logging: use google.api.core._GAXIterator
* Storage: use google.api.core.page_iterator
* Pubsub: use google.api.core._GAXIterator
* Trace: use google.api.core._GAXIterator
* Spanner: use google.api.core._GAXIterator
  • Loading branch information
Jon Wayne Parrott authored Aug 9, 2017
1 parent 2182f6d commit a893273
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/google-cloud-trace/google/cloud/trace/_gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

"""GAX Wrapper for interacting with the Stackdriver Trace API."""

from google.api.core import page_iterator
from google.cloud.gapic.trace.v1 import trace_service_client
from google.cloud.proto.devtools.cloudtrace.v1 import trace_pb2
from google.gax import CallOptions
from google.gax import INITIAL_PAGE
from google.cloud._helpers import make_secure_channel
from google.cloud._http import DEFAULT_USER_AGENT
from google.cloud.iterator import GAXIterator
from google.protobuf.json_format import MessageToDict
from google.protobuf.json_format import ParseDict

Expand Down Expand Up @@ -131,7 +131,7 @@ def list_traces(
passed, the API will return the first page of
entries.
:rtype: :class:`~google.cloud.iterator.Iterator`
:rtype: :class:`~google.api.core.page_iterator.Iterator`
:returns: Traces that match the specified filter conditions.
"""
if page_token is None:
Expand All @@ -147,7 +147,8 @@ def list_traces(
order_by=order_by,
options=options)
item_to_value = _item_to_mapping
return GAXIterator(self.client, page_iter, item_to_value)
return page_iterator._GAXIterator(
self.client, page_iter, item_to_value)


def _parse_trace_pb(trace_pb):
Expand All @@ -169,7 +170,7 @@ def _parse_trace_pb(trace_pb):
def _item_to_mapping(iterator, trace_pb):
"""Helper callable function for the GAXIterator
:type iterator: :class:`~google.cloud.iterator.Iterator`
:type iterator: :class:`~google.api.core.page_iterator.Iterator`
:param iterator: The iterator that is currently in use.
:type trace_pb: :class:`google.cloud.proto.devtools.cloudtrace.v1.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-trace/google/cloud/trace/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def list_traces(
passed, the API will return the first page of
entries.
:rtype: :class:`~google.cloud.iterator.Iterator`
:rtype: :class:`~google.api.core.page_iterator.Iterator`
:returns: Traces that match the specified filter conditions.
"""
if project_id is None:
Expand Down

0 comments on commit a893273

Please sign in to comment.