Skip to content

Commit 4461bf6

Browse files
committed
updated to handle pagination not being fully implmented yet
1 parent 4c5ab64 commit 4461bf6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

splitapiclient/microclients/rule_based_segment_definition_microclient.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def list(self, environment_id, workspace_id, offset=0, limit=50):
7575

7676
# If we reached the end
7777
# (fewer items than limit), then break the loop
78-
if len(current_page_items) < limit:
78+
# or if we have more than limit items, then the pagination logic isn't implemented yet at the api
79+
if len(current_page_items) < limit or len(current_page_items) > limit:
7980
break
8081

8182
# Otherwise move to the next page

splitapiclient/microclients/rule_based_segment_microclient.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def list(self, workspace_id, offset=0, limit=50):
104104
segment_list.extend(current_page_items)
105105

106106
# If we reached the end (fewer items than limit), then break the loop
107-
if len(current_page_items) < limit:
107+
# or if we have more than limit items, then the pagination logic isn't implemented yet at the api
108+
if len(current_page_items) < limit or len(current_page_items) > limit:
108109
break
109110

110111
# Otherwise move to the next page

0 commit comments

Comments
 (0)