Hi,
- Package Name: azure-sdk-for-python comos
- Package Version: 4.1.0
- Operating System: MacOS
- Python Version: 3.7.5
Describe the bug
In a Proxy container, query_items() method returns a ItemPaged object.
This object has a method by_page which can take a continuation_token.
However, after reading the source code. This continuation token seems to never be used anywhere.
The workflow seems to be:
- next for PageIterator (take the continuation token)
- self._get_next (propagates the token
- self._fetch_next (of QueryIterable). Take
*args and do not use them
To Reproduce
# cosmosdb_container a ProxyContainer
query = cosmosdb_container.query_items("select * from r", partition_key=NonePartitionKey, max_item_count=1) # 1 to be sure to have many pages
pager = query.by_page() # pager starting at first object
first_page = pager.next()
token = pager.continuation_token
real_second_page = pager.next()
new_pager = query.by_page(token) # pager supposed to start at object number 2
should_be_second_page = new_pager.next()
assert first_object == should_be_second_object # True but should be False
Expected behavior
real_second_page should be the same as should_be_second_object (from example from above)
Additional context
We were using options["continuation"] in previous version which works just fine with these continuation token so it looks like a regression compared to version 3.x
Have a nice day.
Hi,
Describe the bug
In a Proxy container, query_items() method returns a
ItemPagedobject.This object has a method
by_pagewhich can take acontinuation_token.However, after reading the source code. This continuation token seems to never be used anywhere.
The workflow seems to be:
*argsand do not use themTo Reproduce
Expected behavior
real_second_page should be the same as should_be_second_object (from example from above)
Additional context
We were using
options["continuation"]in previous version which works just fine with these continuation token so it looks like a regression compared to version 3.xHave a nice day.