-
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 Mailchimp - fix the way request params are built #20765
Merged
artem1205
merged 3 commits into
master
from
ddavydov/#1058-source-mailchimp-stream-state-issue-second-try
Jan 9, 2023
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
107 changes: 49 additions & 58 deletions
107
airbyte-integrations/connectors/source-mailchimp/acceptance-test-config.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,57 @@ | ||
connector_image: airbyte/source-mailchimp:dev | ||
tests: | ||
test_strictness_level: high | ||
acceptance_tests: | ||
spec: | ||
- spec_path: "source_mailchimp/spec.json" | ||
timeout_seconds: 60 | ||
tests: | ||
- spec_path: "source_mailchimp/spec.json" | ||
connection: | ||
# for old spec config (without oneOf) | ||
- config_path: "secrets/config.json" | ||
status: "succeed" | ||
timeout_seconds: 180 | ||
# for auth with API token | ||
- config_path: "secrets/config_apikey.json" | ||
status: "succeed" | ||
timeout_seconds: 180 | ||
# for auth with oauth2 token | ||
- config_path: "secrets/config_oauth.json" | ||
status: "succeed" | ||
timeout_seconds: 180 | ||
- config_path: "integration_tests/invalid_config.json" | ||
status: "failed" | ||
timeout_seconds: 180 | ||
- config_path: "integration_tests/invalid_config_apikey.json" | ||
status: "failed" | ||
timeout_seconds: 180 | ||
- config_path: "integration_tests/invalid_config_oauth.json" | ||
status: "failed" | ||
timeout_seconds: 180 | ||
tests: | ||
# for old spec config (without oneOf) | ||
- config_path: "secrets/config.json" | ||
status: "succeed" | ||
# for auth with API token | ||
- config_path: "secrets/config_apikey.json" | ||
status: "succeed" | ||
# for auth with oauth2 token | ||
- config_path: "secrets/config_oauth.json" | ||
status: "succeed" | ||
- config_path: "integration_tests/invalid_config.json" | ||
status: "failed" | ||
- config_path: "integration_tests/invalid_config_apikey.json" | ||
status: "failed" | ||
- config_path: "integration_tests/invalid_config_oauth.json" | ||
status: "failed" | ||
discovery: | ||
# for old spec config (without oneOf) | ||
- config_path: "secrets/config.json" | ||
# for auth with API token | ||
- config_path: "secrets/config_apikey.json" | ||
# for auth with oauth2 token | ||
- config_path: "secrets/config_oauth.json" | ||
tests: | ||
# for old spec config (without oneOf) | ||
- config_path: "secrets/config.json" | ||
# for auth with API token | ||
- config_path: "secrets/config_apikey.json" | ||
# for auth with oauth2 token | ||
- config_path: "secrets/config_oauth.json" | ||
basic_read: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" | ||
timeout_seconds: 1800 | ||
- config_path: "secrets/config_oauth.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" | ||
timeout_seconds: 1800 | ||
# THIS TEST IS COMMENTED OUT. Tests are supposed to accept | ||
# `state = {cursor_field: value}`. When we have dependent endpoint path | ||
# `path_begin/{some_id}/path_end` we need a complex state like below: | ||
# `{"id1": {cursor_field: value}, "id2": {cursor_field: value}...}` | ||
# The test currently is not supposed to accept this desired construction, | ||
# so it is commented out | ||
|
||
# incremental: | ||
# - config_path: "secrets/config.json" | ||
# configured_catalog_path: "integration_tests/configured_catalog.json" | ||
# future_state_path: "integration_tests/state.json" | ||
# cursor_paths: | ||
# lists: [ "date_created" ] | ||
# campaigns: [ "create_time" ] | ||
# Email_activity: [ "timestamp" ] | ||
|
||
tests: | ||
- config_path: "secrets/config.json" | ||
expect_records: | ||
bypass_reason: "Risk to disclose internal data. Need to set up a sandbox account - https://github.com/airbytehq/airbyte/issues/20726" | ||
- config_path: "secrets/config_oauth.json" | ||
expect_records: | ||
bypass_reason: "Risk to disclose internal data. Need to set up a sandbox account - https://github.com/airbytehq/airbyte/issues/20726" | ||
incremental: | ||
tests: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" | ||
future_state: | ||
future_state_path: "integration_tests/state.json" | ||
cursor_paths: | ||
lists: ["date_created"] | ||
campaigns: ["create_time"] | ||
email_activity: ["49d68626f3", "timestamp"] | ||
# Email activities stream has working campaigns with email newsletters. | ||
# Due to this sequential_reads test could be failed. | ||
full_refresh: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog_without_email_activities.json" | ||
timeout_seconds: 1800 | ||
- config_path: "secrets/config_oauth.json" | ||
configured_catalog_path: "integration_tests/configured_catalog_without_email_activities.json" | ||
timeout_seconds: 1800 | ||
tests: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog_without_email_activities.json" | ||
- config_path: "secrets/config_oauth.json" | ||
configured_catalog_path: "integration_tests/configured_catalog_without_email_activities.json" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
1 change: 0 additions & 1 deletion
1
airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/__init__.py
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/mailchimp.py
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
It looks like
cursor_field
is set to timestamp. I know you have a sort_field of create_time but Mailchimp does not allow you to change the sorting. That means that you're going to lose a lot of records. The timestamp should stay the same the offset is what should be used to paginate. You will set the offset too offset = offset + pagesize; The since param should not change.https://mailchimp.com/developer/marketing/docs/methods-parameters/#pagination
As you can see from the list-email-activity docs, there is no sort_field. I believe you're sort variable is just getting ignored.
https://mailchimp.com/developer/marketing/api/email-activity-reports/list-email-activity/
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.
@murphpdx as for now there's just a single slice per campaign, this means we request all the data after the
since
date from the API and dont actually care if there is sorting or not. Can you confirm the bug still persists with you after upgrading to the latest version?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.
You're not paginating? It seems like you are here: https://github.com/airbytehq/airbyte/pull/20765/files#diff-56a4fde71ca00cdb2a92c3716de8b181115d431e07023b7881ee628aa382816cR46
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.
We decided not to use airbyte last summer due in part to this bug. So I don't have the time to test it out for you.
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.
Yes we are paginating and the since param remains the same throughout all the pages within one campaign. The thing is you are pointing to the
stream_slices
method which yields one slice per campaign and the pagination is made within one slice.