Skip to content

Commit 0f29cf2

Browse files
committed
Fix: cursors get re-used when out of data
If we have reached the end of available data when paginating, Obelisk returns a `null` cursor. However, the library does not check for this case and keeps looping, with said cursor set to null, effectively duplicating the result set until the desired size is reached.
1 parent 472122d commit 0f29cf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/obelisk/asynchronous/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ async def query(
256256
result_set.extend(result.items)
257257
params.cursor = result.cursor
258258

259-
if len(result_set) >= result_limit:
259+
if len(result_set) >= result_limit or result.cursor is None:
260260
break
261261

262262
return result_set

0 commit comments

Comments
 (0)