Exit loop if start_after is None and add per_page to query string#7
Open
ahuynh3 wants to merge 2 commits intosinger-io:masterfrom
Open
Exit loop if start_after is None and add per_page to query string#7ahuynh3 wants to merge 2 commits intosinger-io:masterfrom
ahuynh3 wants to merge 2 commits intosinger-io:masterfrom
Conversation
Contributor
|
Hi @ahuynh3, thanks for your contribution! In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. |
Contributor
|
You did it @ahuynh3! Thank you for signing the Singer Contribution License Agreement. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
contactsstream). Currently, thestarting_aftervariable is set toNoneif 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_afteris set toNone.In addition, add the
per_pagequery param so that the samelimitis used throughout the entire paginated result set. Thislimitis set inparamsand gets built up intoquerystringfor the first loop through, but subsequent loops set thequerystringvariable toNone.Manual QA steps
Sample log output with the
per_pagequery param additionRisks
Rollback steps