I encountered an issue when using the JSONResponseCursorPaginator class in rest_client for pagination requests while interacting with Zoom's API. The update_state() method is implemented as follows:
The problem occurs when values is equal to [""], resulting in self._next_reference being set to "" instead of None. This leads to pagination requests continuing to the next page, whereas I expect it to be None to stop further requests.
Expected behavior
The expected behavior is for self._next_reference to be set to None when values is [""], thus preventing further pagination requests. This matches the anticipated termination condition logic.
Steps to reproduce
Use the JSONResponseCursorPaginator to implement pagination requests.
When the value extracted from the JSON response using the specified path is [""], observe the pagination behavior.
Note whether self._next_reference is set to "" instead of None.
dlt version
dlt 1.3.0
Describe the problem
I encountered an issue when using the JSONResponseCursorPaginator class in rest_client for pagination requests while interacting with Zoom's API. The
update_state()
method is implemented as follows:https://github.com/dlt-hub/dlt/blob/75ae23f174e5357a01612e48fe8a475c2db9db35/dlt/sources/helpers/rest_client/paginators.py#L651-L654
The problem occurs when values is equal to
[""]
, resulting in self._next_reference being set to""
instead of None. This leads to pagination requests continuing to the next page, whereas I expect it to be None to stop further requests.Expected behavior
The expected behavior is for
self._next_reference
to be set to None when values is[""]
, thus preventing further pagination requests. This matches the anticipated termination condition logic.Steps to reproduce
JSONResponseCursorPaginator
to implement pagination requests.[""]
, observe the pagination behavior.self._next_reference
is set to""
instead of None.Operating system
Linux
Runtime environment
Kubernetes
Python version
3.11
dlt data source
ZOOM api, e.g. GET /users
dlt destination
Snowflake
Other deployment details
No response
Additional information
I plan to submit a PR to address this issue.