Exit loop if start_after is None and add per_page to query string #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
This issue applies to streams that use cursor based pagination (i.e. the
contacts
stream). Currently, thestarting_after
variable is set toNone
if there's no more data to paginate through. This then gets passed tonext_url
, and a request is made to a URL that looks something likehttps://api.intercom.io/contacts?starting_after=None
. This leads to the following errorThe fix for this is to add a check to break out of the loop when
starting_after
is set toNone
.In addition, add the
per_page
query param so that the samelimit
is used throughout the entire paginated result set. Thislimit
is set inparams
and gets built up intoquerystring
for the first loop through, but subsequent loops set thequerystring
variable toNone
.Manual QA steps
Sample log output with the
per_page
query param additionRisks
Rollback steps