@@ -263,7 +263,7 @@ class _BasePageIterator(Iterator[Sequence[I]]):
263
263
def __init__ (self ,
264
264
client : CloudantV1 ,
265
265
operation : Callable [..., DetailedResponse ],
266
- page_opts : list [str ],
266
+ page_opts : Sequence [str ],
267
267
opts : dict ):
268
268
self ._client : CloudantV1 = client
269
269
self ._has_next : bool = True
@@ -318,7 +318,7 @@ def _get_next_page_options(self, result: R) -> dict:
318
318
class _KeyPageIterator (_BasePageIterator , Generic [K ]):
319
319
320
320
def __init__ (self , client : CloudantV1 , operation : Callable [..., DetailedResponse ], opts : dict ):
321
- super ().__init__ (client , operation , [ ' start_key' , 'start_key_doc_id' ] , opts )
321
+ super ().__init__ (client , operation , ( 'skip' , ' start_key' , 'start_key_doc_id' ,) , opts )
322
322
self ._boundary_failure : Optional [str ] = None
323
323
324
324
def _next_request (self ) -> list [I ]:
@@ -353,8 +353,8 @@ def check_boundary(self, penultimate_item: I, last_item: I) -> Optional[str]:
353
353
354
354
class _BookmarkPageIterator (_BasePageIterator ):
355
355
356
- def __init__ (self , client : CloudantV1 , operation : Callable [..., DetailedResponse ], opts : dict ):
357
- super ().__init__ (client , operation , [ 'bookmark' ] , opts )
356
+ def __init__ (self , client : CloudantV1 , operation : Callable [..., DetailedResponse ], opts : dict , extra_page_opts : Sequence [ str ] = () ):
357
+ super ().__init__ (client , operation , ( 'bookmark' ,) + extra_page_opts , opts )
358
358
359
359
def _get_next_page_options (self , result : R ) -> dict :
360
360
return {'bookmark' : result .bookmark }
@@ -391,6 +391,12 @@ def __init__(self, client: CloudantV1, opts: dict):
391
391
392
392
class _FindBasePageIterator (_BookmarkPageIterator ):
393
393
394
+ def __init__ (self , client : CloudantV1 , operation : Callable [..., DetailedResponse ], opts : dict ):
395
+ # Find requests allow skip, but it should only be used on the first request.
396
+ # Since we don't want it on subsequent page requests we need to exclude it from
397
+ # fixed opts used for the partial function.
398
+ super ().__init__ (client , operation , opts , extra_page_opts = ('skip' ,))
399
+
394
400
def _items (self , result : FindResult ):
395
401
return result .docs
396
402
0 commit comments