-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
✨ Source Mixpanel: add page size to configuration to increase sync speed #41976
Changes from 1 commit
3823c9b
7ffb854
5856f32
7c6e561
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 |
---|---|---|
|
@@ -44,6 +44,9 @@ definitions: | |
- error_message_contains: "Query rate limit exceeded" | ||
action: RETRY | ||
error_message: Query rate limit exceeded. | ||
- error_message_contains: "unknown error" | ||
ChristoGrab marked this conversation as resolved.
Show resolved
Hide resolved
|
||
action: RETRY | ||
error_message: An unknown error occurred | ||
- error_message_contains: "to_date cannot be later than today" | ||
action: FAIL | ||
error_message: Your project timezone must be misconfigured. Please set it to the one defined in your Mixpanel project settings. | ||
|
@@ -150,7 +153,7 @@ definitions: | |
type: CustomPaginationStrategy | ||
class_name: "source_mixpanel.components.EngagePaginationStrategy" | ||
start_from_page: 1 | ||
page_size: 1000 | ||
page_size: "{{ config.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. Allow the configuration of the page size |
||
page_token_option: | ||
type: RequestOption | ||
inject_into: request_parameter | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,6 +119,14 @@ | |
"type": "integer", | ||
"minimum": 1, | ||
"default": 30 | ||
}, | ||
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. Add the page size ton the user defined configuration |
||
"page_size": { | ||
"order": 9, | ||
"title": "Page Size", | ||
"description": "The number of records to fetch per request. Default is 1000.", | ||
descampsk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"type": "integer", | ||
"minimum": 1, | ||
"default": 1000 | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,37 +94,37 @@ def test_streams_string_date(requests_mock, config_raw): | |
"config, success, expected_error_message", | ||
( | ||
( | ||
{"credentials": {"api_secret": "secret"}, "project_timezone": "Miami"}, | ||
{"credentials": {"api_secret": "secret"}, "project_timezone": "Miami", "page_size": 1000}, | ||
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. Needed otherwise the tests fail |
||
False, | ||
"Could not parse time zone: Miami, please enter a valid timezone.", | ||
), | ||
( | ||
{"credentials": {"api_secret": "secret"}, "start_date": "20 Jan 2021"}, | ||
{"credentials": {"api_secret": "secret"}, "start_date": "20 Jan 2021", "page_size": 1000}, | ||
False, | ||
"Could not parse start date: 20 Jan 2021. Please enter a valid start date.", | ||
), | ||
( | ||
{"credentials": {"api_secret": "secret"}, "end_date": "20 Jan 2021"}, | ||
{"credentials": {"api_secret": "secret"}, "end_date": "20 Jan 2021", "page_size": 1000}, | ||
False, | ||
"Could not parse end date: 20 Jan 2021. Please enter a valid end date.", | ||
), | ||
( | ||
{"credentials": {"api_secret": "secret"}, "attribution_window": "20 days"}, | ||
{"credentials": {"api_secret": "secret"}, "attribution_window": "20 days", "page_size": 1000}, | ||
False, | ||
"Please provide a valid integer for the `Attribution window` parameter.", | ||
), | ||
( | ||
{"credentials": {"api_secret": "secret"}, "select_properties_by_default": "Yes"}, | ||
{"credentials": {"api_secret": "secret"}, "select_properties_by_default": "Yes", "page_size": 1000}, | ||
False, | ||
"Please provide a valid True/False value for the `Select properties by default` parameter.", | ||
), | ||
({"credentials": {"api_secret": "secret"}, "region": "UK"}, False, "Region must be either EU or US."), | ||
({"credentials": {"api_secret": "secret"}, "region": "UK", "page_size": 1000}, False, "Region must be either EU or US."), | ||
( | ||
{"credentials": {"username": "user", "secret": "secret"}}, | ||
{"credentials": {"username": "user", "secret": "secret"}, "page_size": 1000}, | ||
False, | ||
"Required parameter 'project_id' missing or malformed. Please provide a valid project ID.", | ||
), | ||
({"credentials": {"api_secret": "secret"}, "region": "EU", "start_date": "2021-02-01T00:00:00Z"}, True, None), | ||
({"credentials": {"api_secret": "secret"}, "region": "EU", "start_date": "2021-02-01T00:00:00Z", "page_size": 1000}, True, None), | ||
( | ||
{ | ||
"credentials": {"username": "user", "secret": "secret", "project_id": 2397709}, | ||
|
@@ -135,6 +135,7 @@ def test_streams_string_date(requests_mock, config_raw): | |
"select_properties_by_default": True, | ||
"region": "EU", | ||
"date_window_size": 10, | ||
"page_size": 1000 | ||
}, | ||
True, | ||
None, | ||
|
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.
To get the real page size from PageIncrement and not
'{{ config.page_size }}'