Skip to content

Commit cb389a7

Browse files
committed
Fix: Strict limit on multi-page queries
We might need to recompute the limit for each page if we are reaching the end of a query.
1 parent c61646c commit cb389a7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Version 2.0.6
2+
-------------
3+
4+
:Date: November 24, 2025
5+
6+
* Fix: Limit is now strict on multi-page queries in CORE
7+
18
Version 2.0.5
29
-------------
310

src/obelisk/asynchronous/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ async def query(self, params: QueryParams) -> list[Datapoint]:
338338
result_limit = params.limit
339339

340340
# Obelisk CORE does not actually stop emitting a cursor when done, limit serves as page limit
341-
params.limit = min(self.page_limit, result_limit)
342341

343342
while True:
343+
params.limit = min(self.page_limit, result_limit - len(result_set))
344344
result: QueryResult = await self.fetch_single_chunk(params)
345345
result_set.extend(result.items)
346346
params.cursor = result.cursor

0 commit comments

Comments
 (0)