Commit 9084ba01 by Oleksandr Barabash

fixed paging

parent 58a7c32f
...@@ -117,12 +117,10 @@ class CosmosClient: ...@@ -117,12 +117,10 @@ class CosmosClient:
return await self.execute_blocking(bl) return await self.execute_blocking(bl)
@staticmethod @staticmethod
def get_next_page_bl(pager): def get_next_page_bl(pager) -> List[Dict[any, any]]:
""" Get Next page items Blocking """ """ Get Next page items Blocking """
try: try:
# todo(s1z): why do we get [0], as MS does? This is bad!!! return list(pager.next())
next_page = pager.next()
return get_first_or_none(list(next_page), list())
except StopIteration: except StopIteration:
Log.e(TAG, "get_next_page_bl:: no items found, returning '[]'", Log.e(TAG, "get_next_page_bl:: no items found, returning '[]'",
exc_info=sys.exc_info()) exc_info=sys.exc_info())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment