Skip to content

Commit 0365f85

Browse files
author
Daniel Bush
committed
chore: tidy up
1 parent aad1613 commit 0365f85

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

sypht/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def get_annotations(
421421
):
422422
page_iter = fetch_all_pages(
423423
name="get_annotations",
424-
fetch_page=lambda *args, **kwargs: self._get_annotations(*args, **kwargs),
424+
fetch_page=self._get_annotations,
425425
get_page=lambda response: response["annotations"],
426426
)
427427
annotations = []
@@ -474,9 +474,7 @@ def _get_annotations(
474474
def get_annotations_for_docs(self, doc_ids, endpoint=None):
475475
page_iter = fetch_all_pages(
476476
name="get_annotations_for_docs",
477-
fetch_page=lambda *args, **kwargs: self._get_annotations_for_docs(
478-
*args, **kwargs
479-
),
477+
fetch_page=self._get_annotations_for_docs,
480478
get_page=lambda response: response["annotations"],
481479
)
482480
annotations = []

sypht/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def fetch_all_pages(
99
) -> Callable[..., Iterator[Any]]:
1010
"""Returns an iterator that calls fetch_page with an offset that we increment by the number of pages fetched. Stop if page returns empty list.
1111
12-
:param fetch_page: the api call that takes an offset (zero-based) that fetches a page of results
12+
:param fetch_page: a function that makes an api call to fetch a page of results (using zero-based offset)
1313
:param get_page: a function that extracts the page from the response
1414
"""
1515

0 commit comments

Comments
 (0)