-
Notifications
You must be signed in to change notification settings - Fork 35
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
TDL-21378 increase page_size for all streams #123
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"api_token":"<token_here>", | ||
"start_date":"2017-01-01", | ||
"page_size":500 | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,11 @@ def __init__(self, config, state): | |
self.config['start_date'] = pendulum.parse(self.config['start_date']) | ||
self.state = state | ||
|
||
# page size configured from config, overrides the default value set in stream.py | ||
page_size = int(self.config.get('page_size',500)) | ||
for stream in self.streams: | ||
stream.limit = stream.next_start = page_size | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we setting the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i agree, and that is what its doing here(https://github.com/singer-io/tap-pipedrive/blob/master/tap_pipedrive/stream.py#L71-L82) def paginate(self, response):
payload = response.json()
if 'additional_data' in payload and 'pagination' in payload['additional_data']:
logger.debug('Paginate: valid response')
pagination = payload['additional_data']['pagination']
if 'more_items_in_collection' in pagination:
self.more_items_in_collection = pagination['more_items_in_collection']
if 'next_start' in pagination:
self.start = pagination['next_start'] i don't think the attribute There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you run this code? To me it looks like stream.limit = stream.next_start = page_size This is also hard to read in my opinion. stream.limit = page_size
stream.next_start = page_size This makes more sense to me. |
||
|
||
def do_discover(self): | ||
logger.info('Starting discover') | ||
|
||
|
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.
Please at a newline at the end of this file
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.
hi @luandy64 , i have tested this code.
self.streams
will refer to the class attributestreams
declared on the class itself, it might not be a good practice to modify class attributes via instances as it can result in an inconsistent state but we are only creating one instance of this class.does this need to be changed?