Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylajin committed Feb 7, 2020
1 parent a2b0bd5 commit 1fc0cb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions apitools/base/py/list_pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def YieldFromList(
current_token_attribute='pageToken',
next_token_attribute='nextPageToken',
batch_size_attribute='maxResults',
get_field_fn=_GetattrNested):
get_field_func=_GetattrNested):
"""Make a series of List requests, keeping track of page tokens.
Args:
Expand All @@ -95,7 +95,8 @@ def YieldFromList(
response message holding the maximum number of results to be
returned. None if caller-specified batch size is unsupported.
If a tuple, path to the attribute.
get_field_fn: lambda, A function that returns the items to be yielded.
get_field_func: Function that returns the items to be yielded. Argument
is response message, and field.
Yields:
protorpc.message.Message, The resources listed by the service.
Expand All @@ -118,7 +119,7 @@ def YieldFromList(
_SetattrNested(request, batch_size_attribute, request_batch_size)
response = getattr(service, method)(request,
global_params=global_params)
items = get_field_fn(response, field)
items = get_field_func(response, field)
if predicate:
items = list(filter(predicate, items))
for item in items:
Expand Down
2 changes: 1 addition & 1 deletion apitools/base/py/list_pager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def Custom_Getter(message, attribute):
client = fusiontables.FusiontablesV1(get_credentials=False)
request = messages.FusiontablesColumnListRequest(tableId='mytable')
results = list_pager.YieldFromList(
client.column, request, get_field_fn=Custom_Getter)
client.column, request, get_field_func=Custom_Getter)

self._AssertInstanceSequence(results, 1)
self.assertEquals(1, len(custom_getter_called))
Expand Down

0 comments on commit 1fc0cb1

Please sign in to comment.