-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stop paging on empty response feature #121
stop paging on empty response feature #121
Conversation
(is (nil? (sut/get-next-page-url response false false)))) | ||
|
||
(let [response {:paging {:next "someurl"} :data []}] | ||
(is (nil? (sut/get-next-page-url response false true)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test case 1 - if stop-on-empty-response is enabled and data
in the reponse is empty (mocked as :data []
) then return nil, and pagination will consequently stop
(is (nil? (sut/get-next-page-url response false true)))) | ||
|
||
(let [response {:paging {:next "someurl"} :data [{:some "data"}]}] | ||
(is (= "someurl" (sut/get-next-page-url response false true)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test case 2 - if stop-on-empty-response is enabled and data
in the reponse is not empty (mocked as :data [{:some "data"}]}
) then return someurl
, and pagination will continue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kód neumím 100% validovat, ale rozumím problému a vypadá to oka
https://keboola.atlassian.net/browse/ST-2131
Stop pagination if response contains empty data but still returns next page url.
This only works if query has enabled
"stop-on-empty-response": true
.queries example with stop-on-empty-response enabled