From ea40bf828e1527da247369bd79982d3197e34c0a Mon Sep 17 00:00:00 2001 From: Tyler Mairose Date: Tue, 3 Mar 2026 12:15:12 -0500 Subject: [PATCH 1/3] Adding the yield functionality to the python sdk --- example.py | 24 +++++- sailpoint/paginator.py | 184 ++++++++++++++++++++++++++++++++++++++++- validation_test.py | 82 ++++++++++++++++++ 3 files changed, 286 insertions(+), 4 deletions(-) diff --git a/example.py b/example.py index 98cd53aa6..451ce9ba8 100644 --- a/example.py +++ b/example.py @@ -1,10 +1,13 @@ +from pprint import pprint + import sailpoint -import sailpoint.v3 import sailpoint.beta +import sailpoint.v3 +import sailpoint.v2025 from sailpoint.configuration import Configuration from sailpoint.paginator import Paginator from sailpoint.v3.models.search import Search -from pprint import pprint +from sailpoint.v2025.models.account import Account configuration = Configuration() @@ -60,4 +63,19 @@ workgroups = sailpoint.beta.GovernanceGroupsApi(api_client).list_workgroups() for workgroup in workgroups: - print(workgroup.name) \ No newline at end of file + print(workgroup.name) + +#Stream v2025 accounts with optional model typing +with sailpoint.v2025.ApiClient(configuration) as api_client: + try: + account_stream = Paginator.paginate_stream( + sailpoint.v2025.AccountsApi(api_client).list_accounts, + 1000, + limit=100, + model=Account + ) + print("Streaming v2025 accounts (paginate_stream with model=Account):\n") + for account in account_stream: + print(account.name) + except Exception as e: + print("Exception when streaming accounts: %s\n" % e) \ No newline at end of file diff --git a/sailpoint/paginator.py b/sailpoint/paginator.py index de3a07d8e..dee80a005 100644 --- a/sailpoint/paginator.py +++ b/sailpoint/paginator.py @@ -1,8 +1,9 @@ from sailpoint.v3.api.search_api import SearchApi from sailpoint.v3.models.search import Search -from typing import TypeVar +from typing import Any, Iterator, Optional, Tuple, Type, TypeVar T = TypeVar('T') +TItem = TypeVar('TItem') class PaginationParams: limit: int @@ -48,6 +49,187 @@ def paginate(T, result_limit, **kwargs) -> T: kwargs['offset'] += increment + @staticmethod + def paginate_stream( + api_call, + result_limit: Optional[int] = None, + *, + model: Optional[Type[TItem]] = None, + **kwargs + ) -> Iterator[TItem]: + """ + Stream paginated results by yielding items as each API page is received. + Optional model parameter is for typing only (e.g. Iterator[Account] when model=Account). + """ + result_limit = result_limit if result_limit else 1000 + increment = kwargs.get('limit') if kwargs.get('limit') is not None else 250 + kwargs['offset'] = kwargs.get('offset') if kwargs.get('offset') is not None else 0 + yielded = 0 + + while True: + print(f'Paginating call, offset = {kwargs["offset"]}') + + results = api_call(**kwargs) + + if isinstance(results, list): + batch = results + else: + batch = results.data + + for item in batch: + yield item + yielded += 1 + if result_limit > 0 and yielded >= result_limit: + return + + if len(batch) < increment: + return + + kwargs['offset'] += increment + + @staticmethod + def paginate_stream_with_http_info( + api_call, + result_limit: Optional[int] = None, + *, + model: Optional[Type[TItem]] = None, + **kwargs + ) -> Tuple[Any, Iterator[TItem]]: + """ + Stream paginated results from a _with_http_info API call. + Expects api_call to return an object with .data (and typically .status_code). + Returns (first_response, iterator) so the caller can check status_code/headers + and then iterate over items. + """ + result_limit = result_limit if result_limit else 1000 + increment = kwargs.get('limit') if kwargs.get('limit') is not None else 250 + kwargs['offset'] = kwargs.get('offset') if kwargs.get('offset') is not None else 0 + + print(f'Paginating call, offset = {kwargs["offset"]}') + results = api_call(**kwargs) + first_response = results + batch = results.data + yielded = 0 + + def _stream(): + nonlocal yielded, batch + for item in batch: + yield item + yielded += 1 + if result_limit > 0 and yielded >= result_limit: + return + + if len(batch) < increment: + return + + while True: + kwargs['offset'] += increment + print(f'Paginating call, offset = {kwargs["offset"]}') + batch = api_call(**kwargs).data + + for item in batch: + yield item + yielded += 1 + if result_limit > 0 and yielded >= result_limit: + return + + if len(batch) < increment: + return + + return (first_response, _stream()) + + @staticmethod + def paginate_stream_search(search_api: SearchApi, search: Search, increment: int, limit: int): + """ + Stream search results by yielding each result as it is received from each API page. + """ + increment = increment if increment else 250 + max_limit = limit if limit else 0 + yielded = 0 + + if search.sort is None or len(search.sort) != 1: + raise Exception('search query must include exactly one sort parameter to paginate properly') + + while True: + print(f'Paginating call') + results = search_api.search_post(search, None, increment) + + for result in results: + yield result + yielded += 1 + if max_limit > 0 and yielded >= max_limit: + return + + print(f'Received {len(results)} results') + + if len(results) < increment: + return + + result = results[len(results) - 1] + if result[search.sort[0].strip('+-')] is not None: + next_search_after = result[str(search.sort[0]).strip('+-')] + search.search_after = [next_search_after] + else: + raise Exception('Search unexpectedly did not return a result we can search after!') + + @staticmethod + def paginate_stream_search_with_http_info( + search_api: SearchApi, search: Search, increment: int, limit: int + ) -> Tuple[Any, Iterator[Any]]: + """ + Stream search results from search_post_with_http_info. + Returns (first_response, iterator) so the caller can check status_code/headers + and then iterate over items. + """ + increment = increment if increment else 250 + max_limit = limit if limit else 0 + yielded = 0 + + if search.sort is None or len(search.sort) != 1: + raise Exception('search query must include exactly one sort parameter to paginate properly') + + print(f'Paginating call') + results = search_api.search_post_with_http_info(search, None, increment) + first_response = results + batch = results.data + + def _stream(): + nonlocal yielded, batch + for result in batch: + yield result + yielded += 1 + if max_limit > 0 and yielded >= max_limit: + return + + print(f'Received {len(batch)} results') + + if len(batch) < increment: + return + + while True: + last = batch[len(batch) - 1] + if last[search.sort[0].strip('+-')] is not None: + next_search_after = last[str(search.sort[0]).strip('+-')] + search.search_after = [next_search_after] + else: + raise Exception('Search unexpectedly did not return a result we can search after!') + + print(f'Paginating call') + batch = search_api.search_post_with_http_info(search, None, increment).data + + for result in batch: + yield result + yielded += 1 + if max_limit > 0 and yielded >= max_limit: + return + + print(f'Received {len(batch)} results') + + if len(batch) < increment: + return + + return (first_response, _stream()) + @staticmethod def paginate_search(search_api: SearchApi, search: Search, increment: int, limit: int): increment = increment if increment else 250 diff --git a/validation_test.py b/validation_test.py index 89e2a6721..38ca52892 100644 --- a/validation_test.py +++ b/validation_test.py @@ -1,8 +1,10 @@ +from typing import Any import unittest import sailpoint.beta import sailpoint.v3 import sailpoint.v2024 +import sailpoint.v2025 import sailpoint.v2026 from sailpoint.configuration import Configuration, ConfigurationParams from sailpoint.paginator import Paginator @@ -16,6 +18,7 @@ class TestPythonSDK(unittest.TestCase): beta_api_client = sailpoint.beta.ApiClient(configuration) configuration.experimental = True v2024_api_client = sailpoint.v2024.ApiClient(configuration) + v2025_api_client = sailpoint.v2025.ApiClient(configuration) v2026_api_client = sailpoint.v2026.ApiClient(configuration) @@ -47,6 +50,19 @@ def test_search_pagination(self): self.assertEqual(100,len(search_results.data)) self.assertEqual(200,search_results.status_code) + def test_paginate_stream_search(self): + """Stream search yields same count as paginate_search when fully consumed.""" + search = Search() + search.indices = ['identities'] + search.query = {'query': '*'} + search.sort = ['-name'] + + stream = Paginator.paginate_stream_search( + sailpoint.v3.SearchApi(self.v3_api_client), search, 10, 100 + ) + items = list(stream) + self.assertEqual(100, len(items)) + def test_list_transforms(self): transforms = sailpoint.v3.TransformsApi(self.v3_api_client).list_transforms_with_http_info() self.assertIsNotNone(transforms.data) @@ -58,6 +74,72 @@ def test_pagination(self): self.assertEqual(100, len(accounts.data)) self.assertEqual(200, accounts.status_code) + def test_paginate_stream(self): + """Stream yields same count as paginate when fully consumed.""" + stream = Paginator.paginate_stream( + sailpoint.v3.AccountsApi(self.v3_api_client).list_accounts_with_http_info, + 100, + limit=10 + ) + items = list(stream) + self.assertEqual(100, len(items)) + + def test_paginate_stream_consumed_incrementally(self): + """Stream yields items as they come; consuming first N then stopping does not require full fetch.""" + stream = Paginator.paginate_stream( + sailpoint.v3.AccountsApi(self.v3_api_client).list_accounts_with_http_info, + 100, + limit=2 + ) + first_three = [] + for i, item in enumerate(stream): + first_three.append(item) + if i >= 2: + break + self.assertGreaterEqual(len(first_three), 1) + self.assertLessEqual(len(first_three), 3) + + def test_paginate_stream_with_model_v2025(self): + """When model=Account is passed, yielded items are typed (and are Account instances).""" + from sailpoint.v2025.models.account import Account + + stream = Paginator.paginate_stream( + sailpoint.v2025.AccountsApi(self.v2025_api_client).list_accounts_with_http_info, + 10, + limit=5, + model=Account + ) + for item in stream: + self.assertIsInstance(item, Account) + break # at least one item has correct type + + def test_paginate_stream_with_http_info(self): + """Stream with _with_http_info returns (first_response, iterator); iterator yields same count.""" + response, stream = Paginator.paginate_stream_with_http_info( + sailpoint.v3.AccountsApi(self.v3_api_client).list_accounts_with_http_info, + 100, + limit=10 + ) + self.assertIsNotNone(response) + self.assertEqual(200, response.status_code) + items = list(stream) + self.assertEqual(100, len(items)) + + def test_paginate_stream_search_with_http_info(self): + """Stream search with _with_http_info returns (first_response, iterator); iterator yields same count.""" + search = Search() + search.indices = ['identities'] + search.query = {'query': '*'} + search.sort = ['-name'] + + response, stream = Paginator.paginate_stream_search_with_http_info( + sailpoint.v3.SearchApi(self.v3_api_client), search, 10, 100 + ) + self.assertIsNotNone(response) + self.assertEqual(200, response.status_code) + items = list(stream) + self.assertEqual(100, len(items)) + def test_list_accounts_beta(self): accounts = sailpoint.beta.AccountsApi(self.beta_api_client).list_accounts_with_http_info() self.assertIsNotNone(accounts.data) From 953bf8dcd32fc03625d4dbf56b5889502f67d7f2 Mon Sep 17 00:00:00 2001 From: Tyler Mairose Date: Tue, 3 Mar 2026 15:31:57 -0500 Subject: [PATCH 2/3] Minor changes for useability --- example.py | 30 +++++++++++++-- sailpoint/paginator.py | 84 ++++++++++++------------------------------ validation_test.py | 22 ++++++----- 3 files changed, 63 insertions(+), 73 deletions(-) diff --git a/example.py b/example.py index 451ce9ba8..314d1ac73 100644 --- a/example.py +++ b/example.py @@ -39,7 +39,7 @@ "Exception when calling AccessProfilesApi->list_access_profiles: %s\n" % e ) - # Use the paginator with search + #Use the paginator with search search = Search() search.indices = ['identities'] @@ -49,8 +49,16 @@ identities = Paginator.paginate_search(sailpoint.v3.SearchApi(api_client),search, 250, 1000) for identity in identities: print(identity['name']) - + # Stream search results using paginate_stream_search + search_stream = Search() + search_stream.indices = ['identities'] + search_stream.query = { 'query': '*' } + search_stream.sort = ['-name'] + + print("Streaming search results (paginate_stream_search):\n") + for identity in Paginator.paginate_stream_search(sailpoint.v3.SearchApi(api_client), search_stream, 250, 1000): + print(identity['name']) # Use the paginator to paginate 1000 accounts 100 at a time accounts = Paginator.paginate(sailpoint.v3.AccountsApi(api_client).list_accounts, 1000, limit=100) @@ -78,4 +86,20 @@ for account in account_stream: print(account.name) except Exception as e: - print("Exception when streaming accounts: %s\n" % e) \ No newline at end of file + print("Exception when streaming accounts: %s\n" % e) + +# Stream v2025 accounts with HTTP info (status code, headers) and optional model typing +with sailpoint.v2025.ApiClient(configuration) as api_client: + try: + account_stream = Paginator.paginate_stream_with_http_info( + sailpoint.v2025.AccountsApi(api_client).list_accounts_with_http_info, + 1000, + limit=100, + model=Account + ) + print("Streaming v2025 accounts (paginate_stream_with_http_info):\n") + for account, response in account_stream: + print(f"[{response.status_code}] {account.name}") + except Exception as e: + print("Exception when streaming accounts with http info: %s\n" % e) + diff --git a/sailpoint/paginator.py b/sailpoint/paginator.py index dee80a005..9019a3a59 100644 --- a/sailpoint/paginator.py +++ b/sailpoint/paginator.py @@ -94,27 +94,24 @@ def paginate_stream_with_http_info( *, model: Optional[Type[TItem]] = None, **kwargs - ) -> Tuple[Any, Iterator[TItem]]: + ) -> Iterator[Tuple[TItem, Any]]: """ Stream paginated results from a _with_http_info API call. - Expects api_call to return an object with .data (and typically .status_code). - Returns (first_response, iterator) so the caller can check status_code/headers - and then iterate over items. + Yields (item, response) tuples so callers can inspect status_code/headers + for every page, not just the first. """ result_limit = result_limit if result_limit else 1000 increment = kwargs.get('limit') if kwargs.get('limit') is not None else 250 kwargs['offset'] = kwargs.get('offset') if kwargs.get('offset') is not None else 0 - - print(f'Paginating call, offset = {kwargs["offset"]}') - results = api_call(**kwargs) - first_response = results - batch = results.data yielded = 0 - def _stream(): - nonlocal yielded, batch + while True: + print(f'Paginating call, offset = {kwargs["offset"]}') + response = api_call(**kwargs) + batch = response.data + for item in batch: - yield item + yield (item, response) yielded += 1 if result_limit > 0 and yielded >= result_limit: return @@ -122,21 +119,7 @@ def _stream(): if len(batch) < increment: return - while True: - kwargs['offset'] += increment - print(f'Paginating call, offset = {kwargs["offset"]}') - batch = api_call(**kwargs).data - - for item in batch: - yield item - yielded += 1 - if result_limit > 0 and yielded >= result_limit: - return - - if len(batch) < increment: - return - - return (first_response, _stream()) + kwargs['offset'] += increment @staticmethod def paginate_stream_search(search_api: SearchApi, search: Search, increment: int, limit: int): @@ -175,11 +158,11 @@ def paginate_stream_search(search_api: SearchApi, search: Search, increment: int @staticmethod def paginate_stream_search_with_http_info( search_api: SearchApi, search: Search, increment: int, limit: int - ) -> Tuple[Any, Iterator[Any]]: + ) -> Iterator[Tuple[Any, Any]]: """ Stream search results from search_post_with_http_info. - Returns (first_response, iterator) so the caller can check status_code/headers - and then iterate over items. + Yields (item, response) tuples so callers can inspect status_code/headers + for every page, not just the first. """ increment = increment if increment else 250 max_limit = limit if limit else 0 @@ -188,15 +171,13 @@ def paginate_stream_search_with_http_info( if search.sort is None or len(search.sort) != 1: raise Exception('search query must include exactly one sort parameter to paginate properly') - print(f'Paginating call') - results = search_api.search_post_with_http_info(search, None, increment) - first_response = results - batch = results.data + while True: + print(f'Paginating call') + response = search_api.search_post_with_http_info(search, None, increment) + batch = response.data - def _stream(): - nonlocal yielded, batch for result in batch: - yield result + yield (result, response) yielded += 1 if max_limit > 0 and yielded >= max_limit: return @@ -206,29 +187,12 @@ def _stream(): if len(batch) < increment: return - while True: - last = batch[len(batch) - 1] - if last[search.sort[0].strip('+-')] is not None: - next_search_after = last[str(search.sort[0]).strip('+-')] - search.search_after = [next_search_after] - else: - raise Exception('Search unexpectedly did not return a result we can search after!') - - print(f'Paginating call') - batch = search_api.search_post_with_http_info(search, None, increment).data - - for result in batch: - yield result - yielded += 1 - if max_limit > 0 and yielded >= max_limit: - return - - print(f'Received {len(batch)} results') - - if len(batch) < increment: - return - - return (first_response, _stream()) + last = batch[len(batch) - 1] + if last[search.sort[0].strip('+-')] is not None: + next_search_after = last[str(search.sort[0]).strip('+-')] + search.search_after = [next_search_after] + else: + raise Exception('Search unexpectedly did not return a result we can search after!') @staticmethod def paginate_search(search_api: SearchApi, search: Search, increment: int, limit: int): diff --git a/validation_test.py b/validation_test.py index 38ca52892..916bdf486 100644 --- a/validation_test.py +++ b/validation_test.py @@ -114,30 +114,32 @@ def test_paginate_stream_with_model_v2025(self): break # at least one item has correct type def test_paginate_stream_with_http_info(self): - """Stream with _with_http_info returns (first_response, iterator); iterator yields same count.""" - response, stream = Paginator.paginate_stream_with_http_info( + """Yields (item, response) tuples; every tuple carries the response from its page.""" + stream = Paginator.paginate_stream_with_http_info( sailpoint.v3.AccountsApi(self.v3_api_client).list_accounts_with_http_info, 100, limit=10 ) - self.assertIsNotNone(response) - self.assertEqual(200, response.status_code) - items = list(stream) + items = [] + for item, response in stream: + self.assertEqual(200, response.status_code) + items.append(item) self.assertEqual(100, len(items)) def test_paginate_stream_search_with_http_info(self): - """Stream search with _with_http_info returns (first_response, iterator); iterator yields same count.""" + """Yields (item, response) tuples; every tuple carries the response from its page.""" search = Search() search.indices = ['identities'] search.query = {'query': '*'} search.sort = ['-name'] - response, stream = Paginator.paginate_stream_search_with_http_info( + stream = Paginator.paginate_stream_search_with_http_info( sailpoint.v3.SearchApi(self.v3_api_client), search, 10, 100 ) - self.assertIsNotNone(response) - self.assertEqual(200, response.status_code) - items = list(stream) + items = [] + for item, response in stream: + self.assertEqual(200, response.status_code) + items.append(item) self.assertEqual(100, len(items)) def test_list_accounts_beta(self): From 40409f4bf5d13a96eb00fa544f8b09559f6820d9 Mon Sep 17 00:00:00 2001 From: Tyler Mairose Date: Wed, 4 Mar 2026 12:43:51 -0500 Subject: [PATCH 3/3] Add paginator logging to logger instead of print, implement overrides for better IDE experience --- example.py | 4 +++ sailpoint/paginator.py | 70 +++++++++++++++++++++++++++++++++--------- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/example.py b/example.py index 314d1ac73..dbf07db02 100644 --- a/example.py +++ b/example.py @@ -1,5 +1,8 @@ +import logging from pprint import pprint +logging.basicConfig(level=logging.DEBUG) + import sailpoint import sailpoint.beta import sailpoint.v3 @@ -103,3 +106,4 @@ except Exception as e: print("Exception when streaming accounts with http info: %s\n" % e) + diff --git a/sailpoint/paginator.py b/sailpoint/paginator.py index 9019a3a59..cebd23aed 100644 --- a/sailpoint/paginator.py +++ b/sailpoint/paginator.py @@ -1,10 +1,13 @@ +import logging from sailpoint.v3.api.search_api import SearchApi from sailpoint.v3.models.search import Search -from typing import Any, Iterator, Optional, Tuple, Type, TypeVar +from typing import Any, Callable, Iterator, Optional, Tuple, Type, TypeVar, overload T = TypeVar('T') TItem = TypeVar('TItem') +logger = logging.getLogger(__name__) + class PaginationParams: limit: int offset: int @@ -28,7 +31,7 @@ def paginate(T, result_limit, **kwargs) -> T: modified = [] while True: - print(f'Paginating call, offset = {kwargs["offset"]}') + logger.debug(f'Paginating call, offset = {kwargs["offset"]}') # Call endpoint and pass any arguments results = T(**kwargs) @@ -49,9 +52,27 @@ def paginate(T, result_limit, **kwargs) -> T: kwargs['offset'] += increment + @overload + @staticmethod + def paginate_stream( + api_call: Callable[..., Any], + result_limit: Optional[int] = None, + *, + model: Type[TItem], + **kwargs + ) -> Iterator[TItem]: ... + + @overload + @staticmethod + def paginate_stream( + api_call: Callable[..., Any], + result_limit: Optional[int] = None, + **kwargs + ) -> Iterator[Any]: ... + @staticmethod def paginate_stream( - api_call, + api_call: Callable[..., Any], result_limit: Optional[int] = None, *, model: Optional[Type[TItem]] = None, @@ -59,7 +80,7 @@ def paginate_stream( ) -> Iterator[TItem]: """ Stream paginated results by yielding items as each API page is received. - Optional model parameter is for typing only (e.g. Iterator[Account] when model=Account). + When model is provided, the iterator is typed as Iterator[model] for IDE support. """ result_limit = result_limit if result_limit else 1000 increment = kwargs.get('limit') if kwargs.get('limit') is not None else 250 @@ -67,7 +88,7 @@ def paginate_stream( yielded = 0 while True: - print(f'Paginating call, offset = {kwargs["offset"]}') + logger.debug(f'Paginating call, offset = {kwargs["offset"]}') results = api_call(**kwargs) @@ -87,9 +108,27 @@ def paginate_stream( kwargs['offset'] += increment + @overload + @staticmethod + def paginate_stream_with_http_info( + api_call: Callable[..., Any], + result_limit: Optional[int] = None, + *, + model: Type[TItem], + **kwargs + ) -> Iterator[Tuple[TItem, Any]]: ... + + @overload + @staticmethod + def paginate_stream_with_http_info( + api_call: Callable[..., Any], + result_limit: Optional[int] = None, + **kwargs + ) -> Iterator[Tuple[Any, Any]]: ... + @staticmethod def paginate_stream_with_http_info( - api_call, + api_call: Callable[..., Any], result_limit: Optional[int] = None, *, model: Optional[Type[TItem]] = None, @@ -99,6 +138,7 @@ def paginate_stream_with_http_info( Stream paginated results from a _with_http_info API call. Yields (item, response) tuples so callers can inspect status_code/headers for every page, not just the first. + When model is provided, items in the tuples are typed as model for IDE support. """ result_limit = result_limit if result_limit else 1000 increment = kwargs.get('limit') if kwargs.get('limit') is not None else 250 @@ -106,7 +146,7 @@ def paginate_stream_with_http_info( yielded = 0 while True: - print(f'Paginating call, offset = {kwargs["offset"]}') + logger.debug(f'Paginating call, offset = {kwargs["offset"]}') response = api_call(**kwargs) batch = response.data @@ -134,7 +174,7 @@ def paginate_stream_search(search_api: SearchApi, search: Search, increment: int raise Exception('search query must include exactly one sort parameter to paginate properly') while True: - print(f'Paginating call') + logger.debug('Paginating call') results = search_api.search_post(search, None, increment) for result in results: @@ -143,7 +183,7 @@ def paginate_stream_search(search_api: SearchApi, search: Search, increment: int if max_limit > 0 and yielded >= max_limit: return - print(f'Received {len(results)} results') + logger.debug(f'Received {len(results)} results') if len(results) < increment: return @@ -172,7 +212,7 @@ def paginate_stream_search_with_http_info( raise Exception('search query must include exactly one sort parameter to paginate properly') while True: - print(f'Paginating call') + logger.debug('Paginating call') response = search_api.search_post_with_http_info(search, None, increment) batch = response.data @@ -182,7 +222,7 @@ def paginate_stream_search_with_http_info( if max_limit > 0 and yielded >= max_limit: return - print(f'Received {len(batch)} results') + logger.debug(f'Received {len(batch)} results') if len(batch) < increment: return @@ -206,11 +246,11 @@ def paginate_search(search_api: SearchApi, search: Search, increment: int, limit raise Exception('search query must include exactly one sort parameter to paginate properly') while True: - print(f'Paginating call, offset = {offset}') + logger.debug(f'Paginating call, offset = {offset}') results = search_api.search_post(search, None, increment) modified = modified + results - print(f'Received {len(results)} results') + logger.debug(f'Received {len(results)} results') if len(results) < increment or (len(modified) >= max_limit and max_limit > 0): results = modified @@ -237,11 +277,11 @@ def paginate_search_with_http_info(search_api: SearchApi, search: Search, increm raise Exception('search query must include exactly one sort parameter to paginate properly') while True: - print(f'Paginating call, offset = {offset}') + logger.debug(f'Paginating call, offset = {offset}') results = search_api.search_post_with_http_info(search, None, increment) modified = modified + results.data - print(f'Recieved {len(results.data)} results') + logger.debug(f'Received {len(results.data)} results') if len(results.data) < increment or (len(modified) >= max_limit and max_limit > 0): results.data = modified