From 5f493bd00f5627c2ecea07933f04764c26d2dfe1 Mon Sep 17 00:00:00 2001 From: Denys Davydov Date: Wed, 21 Dec 2022 20:49:35 +0200 Subject: [PATCH 1/2] 1058 source mailchimp - fix the way request params are built --- .../connectors/source-mailchimp/Dockerfile | 6 +- .../acceptance-test-config.yml | 107 ++++++++---------- .../integration_tests/configured_catalog.json | 10 +- ...ured_catalog_without_email_activities.json | 2 + .../integration_tests/state.json | 6 +- .../connectors/source-mailchimp/setup.py | 2 +- .../source_mailchimp/models/__init__.py | 1 - .../source_mailchimp/models/mailchimp.py | 14 --- .../source_mailchimp/source.py | 7 +- .../source_mailchimp/spec.json | 5 + .../source_mailchimp/streams.py | 68 +++++++---- .../unit_tests/test_streams.py | 10 +- docs/integrations/sources/mailchimp.md | 55 ++++----- 13 files changed, 154 insertions(+), 139 deletions(-) delete mode 100644 airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/__init__.py delete mode 100644 airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/mailchimp.py diff --git a/airbyte-integrations/connectors/source-mailchimp/Dockerfile b/airbyte-integrations/connectors/source-mailchimp/Dockerfile index 84fe47f2ab50..6789e0b3806f 100644 --- a/airbyte-integrations/connectors/source-mailchimp/Dockerfile +++ b/airbyte-integrations/connectors/source-mailchimp/Dockerfile @@ -4,13 +4,13 @@ FROM python:3.9-slim RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/* WORKDIR /airbyte/integration_code -COPY source_mailchimp ./source_mailchimp -COPY main.py ./ COPY setup.py ./ RUN pip install . +COPY source_mailchimp ./source_mailchimp +COPY main.py ./ ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.3.0 +LABEL io.airbyte.version=0.3.1 LABEL io.airbyte.name=airbyte/source-mailchimp diff --git a/airbyte-integrations/connectors/source-mailchimp/acceptance-test-config.yml b/airbyte-integrations/connectors/source-mailchimp/acceptance-test-config.yml index 204e59260a57..f248066567ba 100644 --- a/airbyte-integrations/connectors/source-mailchimp/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-mailchimp/acceptance-test-config.yml @@ -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" diff --git a/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog.json index c8471a3077b4..04af755e9e2b 100644 --- a/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog.json +++ b/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog.json @@ -11,6 +11,7 @@ }, "sync_mode": "incremental", "cursor_field": ["create_time"], + "primary_key": [["id"]], "destination_sync_mode": "append" }, { @@ -22,9 +23,10 @@ "default_cursor_field": ["date_created"], "source_defined_primary_key": [["id"]] }, - "sync_mode": "incremental", + "sync_mode": "incremental", "cursor_field": ["date_created"], - "destination_sync_mode": "append" + "destination_sync_mode": "append", + "primary_key": [["id"]] }, { "stream": { @@ -32,10 +34,12 @@ "json_schema": {}, "supported_sync_modes": ["incremental", "full_refresh"], "source_defined_cursor": true, - "default_cursor_field": ["timestamp"] + "default_cursor_field": ["timestamp"], + "source_defined_primary_key": [["timestamp"], ["email_id"], ["action"]] }, "sync_mode": "incremental", "cursor_field": ["timestamp"], + "primary_key": [["timestamp"], ["email_id"], ["action"]], "destination_sync_mode": "append" } ] diff --git a/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog_without_email_activities.json b/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog_without_email_activities.json index 9024d5eefbbc..80710c6af509 100644 --- a/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog_without_email_activities.json +++ b/airbyte-integrations/connectors/source-mailchimp/integration_tests/configured_catalog_without_email_activities.json @@ -11,6 +11,7 @@ }, "sync_mode": "incremental", "cursor_field": ["create_time"], + "primary_key": [["id"]], "destination_sync_mode": "append" }, { @@ -24,6 +25,7 @@ }, "sync_mode": "incremental", "cursor_field": ["date_created"], + "primary_key": [["id"]], "destination_sync_mode": "append" } ] diff --git a/airbyte-integrations/connectors/source-mailchimp/integration_tests/state.json b/airbyte-integrations/connectors/source-mailchimp/integration_tests/state.json index 4abc78540212..723f2c8ca5df 100644 --- a/airbyte-integrations/connectors/source-mailchimp/integration_tests/state.json +++ b/airbyte-integrations/connectors/source-mailchimp/integration_tests/state.json @@ -2,14 +2,14 @@ { "type": "STREAM", "stream": { - "stream_state": { "create_time": "2020-11-23T05:42:11+00:00" }, + "stream_state": { "create_time": "2220-11-23T05:42:11+00:00" }, "stream_descriptor": { "name": "campaigns" } } }, { "type": "STREAM", "stream": { - "stream_state": { "date_created": "2020-09-25T04:47:31+00:00" }, + "stream_state": { "date_created": "2220-09-25T04:47:31+00:00" }, "stream_descriptor": { "name": "lists" } } }, @@ -17,7 +17,7 @@ "type": "STREAM", "stream": { "stream_state": { - "49d68626f3": { "timestamp": "2020-11-23T05:42:10+00:00" } + "49d68626f3": { "timestamp": "2220-11-23T05:42:10+00:00" } }, "stream_descriptor": { "name": "email_activity" } } diff --git a/airbyte-integrations/connectors/source-mailchimp/setup.py b/airbyte-integrations/connectors/source-mailchimp/setup.py index 442372dde2ec..e84651c46a97 100644 --- a/airbyte-integrations/connectors/source-mailchimp/setup.py +++ b/airbyte-integrations/connectors/source-mailchimp/setup.py @@ -15,7 +15,7 @@ author_email="contact@airbyte.io", packages=find_packages(), install_requires=[ - "airbyte-cdk~=0.1", + "airbyte-cdk", "pytest~=6.1", ], package_data={"": ["*.json", "schemas/*.json", "schemas/shared/*.json"]}, diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/__init__.py b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/__init__.py deleted file mode 100644 index c84397a49451..000000000000 --- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .mailchimp import HealthCheckError diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/mailchimp.py b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/mailchimp.py deleted file mode 100644 index eb1aac9dc633..000000000000 --- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/models/mailchimp.py +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2022 Airbyte, Inc., all rights reserved. -# - - -from pydantic import BaseModel - - -class HealthCheckError(BaseModel): - type: str - title: str - status: int - detail: str - instance: str diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py index 7666598d786b..1f1650a044af 100644 --- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py +++ b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py @@ -63,4 +63,9 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> def streams(self, config: Mapping[str, Any]) -> List[Stream]: authenticator = MailChimpAuthenticator().get_auth(config) - return [Lists(authenticator=authenticator), Campaigns(authenticator=authenticator), EmailActivity(authenticator=authenticator)] + campaign_id = config.get("campaign_id") + return [ + Lists(authenticator=authenticator), + Campaigns(authenticator=authenticator), + EmailActivity(authenticator=authenticator, campaign_id=campaign_id) + ] diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/spec.json b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/spec.json index 5bf88b220ca1..c18777fcd36b 100644 --- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/spec.json +++ b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/spec.json @@ -60,6 +60,11 @@ } } ] + }, + "campaign_id": { + "type": "string", + "title": "ID of a campaign to sync email activities", + "airbyte_hidden": true } } }, diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py index af1fa6b12a4b..40b42330d5a7 100644 --- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py +++ b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py @@ -5,7 +5,7 @@ import math from abc import ABC, abstractmethod -from typing import Any, Iterable, Mapping, MutableMapping, Optional +from typing import Any, Iterable, List, Mapping, MutableMapping, Optional import requests from airbyte_cdk.models import SyncMode @@ -14,7 +14,7 @@ class MailChimpStream(HttpStream, ABC): primary_key = "id" - page_size = 100 + page_size = 1000 def __init__(self, **kwargs): super().__init__(**kwargs) @@ -72,6 +72,14 @@ def cursor_field(self) -> str: """ pass + @property + def filter_field(self): + return f"since_{self.cursor_field}" + + @property + def sort_field(self): + return self.cursor_field + def get_updated_state(self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]) -> Mapping[str, Any]: """ Return the latest state by comparing the cursor value in the latest record with the stream's most recent state object @@ -81,13 +89,21 @@ def get_updated_state(self, current_stream_state: MutableMapping[str, Any], late current_state = current_stream_state.get(self.cursor_field) or latest_state return {self.cursor_field: max(latest_state, current_state)} - def request_params(self, stream_state=None, **kwargs): + def stream_slices( + self, *, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None + ) -> Iterable[Optional[Mapping[str, Any]]]: + slice_ = {} stream_state = stream_state or {} - params = super().request_params(stream_state=stream_state, **kwargs) - default_params = {"sort_field": self.cursor_field, "sort_dir": "ASC"} - since_value = stream_state.get(self.cursor_field) - if since_value: - default_params[f"since_{self.cursor_field}"] = since_value + cursor_value = stream_state.get(self.cursor_field) + if cursor_value: + slice_[self.filter_field] = cursor_value + yield slice_ + + def request_params(self, stream_state=None, stream_slice=None, **kwargs): + stream_state = stream_state or {} + stream_slice = stream_slice or {} + params = super().request_params(stream_state=stream_state, stream_slice=stream_slice, **kwargs) + default_params = {"sort_field": self.sort_field, "sort_dir": "ASC", **stream_slice} params.update(default_params) return params @@ -110,13 +126,30 @@ def path(self, **kwargs) -> str: class EmailActivity(IncrementalMailChimpStream): cursor_field = "timestamp" + filter_field = "since" + sort_field = "create_time" data_field = "emails" primary_key = ["timestamp", "email_id", "action"] - def stream_slices(self, **kwargs): - campaign_stream = Campaigns(authenticator=self.authenticator) - for campaign in campaign_stream.read_records(sync_mode=SyncMode.full_refresh): - yield {"campaign_id": campaign["id"]} + def __init__(self, campaign_id: Optional[str] = None, **kwargs): + super().__init__(**kwargs) + self.campaign_id = campaign_id + + def stream_slices( + self, *, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None + ) -> Iterable[Optional[Mapping[str, Any]]]: + stream_state = stream_state or {} + if self.campaign_id: + # this is a workaround to speed up SATs and enable incremental tests + campaigns = [{"id": self.campaign_id}] + else: + campaigns = Campaigns(authenticator=self.authenticator).read_records(sync_mode=SyncMode.full_refresh) + for campaign in campaigns: + slice_ = {"campaign_id": campaign["id"]} + cursor_value = stream_state.get(campaign["id"], {}).get(self.cursor_field) + if cursor_value: + slice_[self.filter_field] = cursor_value + yield slice_ def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str: campaign_id = stream_slice["campaign_id"] @@ -140,17 +173,6 @@ def get_updated_state(self, current_stream_state: MutableMapping[str, Any], late current_stream_state[campaign_id] = new_value return current_stream_state - def request_params(self, stream_state=None, stream_slice: Mapping[str, Any] = None, **kwargs): - stream_state = stream_state or {} - params = MailChimpStream.request_params(self, stream_state=stream_state, **kwargs) - - since_value_camp = stream_state.get(stream_slice["campaign_id"]) - if since_value_camp: - since_value = since_value_camp.get(self.cursor_field) - if since_value: - params["since"] = since_value - return params - def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapping]: response_json = response.json() # transform before save diff --git a/airbyte-integrations/connectors/source-mailchimp/unit_tests/test_streams.py b/airbyte-integrations/connectors/source-mailchimp/unit_tests/test_streams.py index cdf7c776f762..2f85c32b5ab1 100644 --- a/airbyte-integrations/connectors/source-mailchimp/unit_tests/test_streams.py +++ b/airbyte-integrations/connectors/source-mailchimp/unit_tests/test_streams.py @@ -41,9 +41,9 @@ def test_next_page_token(auth): expected_token = None assert stream.next_page_token(**inputs) == expected_token - resp = {"lists": [{"id": i} for i in range(101)]} + resp = {"lists": [{"id": i} for i in range(1001)]} inputs = {"response": MagicMock(json=MagicMock(return_value=resp))} - expected_token = {"offset": 100} + expected_token = {"offset": 1000} assert stream.next_page_token(**inputs) == expected_token @@ -52,11 +52,11 @@ def test_next_page_token(auth): [ ( {"stream_slice": None, "stream_state": None, "next_page_token": None}, - {"count": 100, "sort_dir": "ASC", "sort_field": "date_created"}, + {"count": 1000, "sort_dir": "ASC", "sort_field": "date_created"}, ), ( - {"stream_slice": None, "stream_state": None, "next_page_token": {"offset": 100}}, - {"count": 100, "sort_dir": "ASC", "sort_field": "date_created", "offset": 100}, + {"stream_slice": None, "stream_state": None, "next_page_token": {"offset": 1000}}, + {"count": 1000, "sort_dir": "ASC", "sort_field": "date_created", "offset": 1000}, ), ], ) diff --git a/docs/integrations/sources/mailchimp.md b/docs/integrations/sources/mailchimp.md index 76ee9e4816d3..a366a6d9e52a 100644 --- a/docs/integrations/sources/mailchimp.md +++ b/docs/integrations/sources/mailchimp.md @@ -212,13 +212,13 @@ The `Lists` and `Campaigns` streams have `id` as the primary key. The `Email Act ## Data type mapping -| Integration Type | Airbyte Type | Notes | -| :--- | :--- | :--- | -| `array` | `array` | the type of elements in the array is determined based on the mappings in this table | -| `date`, `time`, `datetime` | `string` | | -| `int`, `float`, `number` | `number` | | -| `object` | `object` | properties within objects are mapped based on the mappings in this table | -| `string` | `string` | | +| Integration Type | Airbyte Type | Notes | +|:---------------------------|:-------------|:------------------------------------------------------------------------------------| +| `array` | `array` | the type of elements in the array is determined based on the mappings in this table | +| `date`, `time`, `datetime` | `string` | | +| `int`, `float`, `number` | `number` | | +| `object` | `object` | properties within objects are mapped based on the mappings in this table | +| `string` | `string` | | ## Tutorials @@ -228,24 +228,25 @@ Now that you have set up the Mailchimp source connector, check out the following ## Changelog -| Version | Date | Pull Request | Subject | -|---------|------------|----------------------------------------------------------|--------------------------------------------------------------------------| -| 0.3.0 | 2022-11-07 | [19023](https://github.com/airbytehq/airbyte/pull/19023) | Set primary key for Email Activity stream. | -| 0.2.15 | 2022-09-28 | [17326](https://github.com/airbytehq/airbyte/pull/17326) | Migrate to per-stream states. | -| 0.2.14 | 2022-04-12 | [11352](https://github.com/airbytehq/airbyte/pull/11352) | Update documentation | -| 0.2.13 | 2022-04-11 | [11632](https://github.com/airbytehq/airbyte/pull/11632) | Add unit tests | -| 0.2.12 | 2022-03-17 | [10975](https://github.com/airbytehq/airbyte/pull/10975) | Fix campaign's stream normalization | -| 0.2.11 | 2021-12-24 | [7159](https://github.com/airbytehq/airbyte/pull/7159) | Add oauth2.0 support | -| 0.2.10 | 2021-12-21 | [9000](https://github.com/airbytehq/airbyte/pull/9000) | Update connector fields title/description | -| 0.2.9 | 2021-12-13 | [7975](https://github.com/airbytehq/airbyte/pull/7975) | Updated JSON schemas | -| 0.2.8 | 2021-08-17 | [5481](https://github.com/airbytehq/airbyte/pull/5481) | Remove date-time type from some fields | -| 0.2.7 | 2021-08-03 | [5137](https://github.com/airbytehq/airbyte/pull/5137) | Source Mailchimp: fix primary key for email activities | -| 0.2.6 | 2021-07-28 | [5024](https://github.com/airbytehq/airbyte/pull/5024) | Source Mailchimp: handle records with no no "activity" field in response | -| 0.2.5 | 2021-07-08 | [4621](https://github.com/airbytehq/airbyte/pull/4621) | Mailchimp fix url-base | -| 0.2.4 | 2021-06-09 | [4285](https://github.com/airbytehq/airbyte/pull/4285) | Use datacenter URL parameter from apikey | -| 0.2.3 | 2021-06-08 | [3973](https://github.com/airbytehq/airbyte/pull/3973) | Add AIRBYTE\_ENTRYPOINT for Kubernetes support | -| 0.2.2 | 2021-06-08 | [3415](https://github.com/airbytehq/airbyte/pull/3415) | Get Members activities | -| 0.2.1 | 2021-04-03 | [2726](https://github.com/airbytehq/airbyte/pull/2726) | Fix base connector versioning | -| 0.2.0 | 2021-03-09 | [2238](https://github.com/airbytehq/airbyte/pull/2238) | Protocol allows future/unknown properties | -| 0.1.4 | 2020-11-30 | [1046](https://github.com/airbytehq/airbyte/pull/1046) | Add connectors using an index YAML file | +| Version | Date | Pull Request | Subject | +|---------|------------|----------------------------------------------------------|----------------------------------------------------------------------------| +| 0.3.1 | 2022-12-20 | [20720](https://github.com/airbytehq/airbyte/pull/20720) | Use stream slices as a source for request params instead of a stream state | +| 0.3.0 | 2022-11-07 | [19023](https://github.com/airbytehq/airbyte/pull/19023) | Set primary key for Email Activity stream. | +| 0.2.15 | 2022-09-28 | [17326](https://github.com/airbytehq/airbyte/pull/17326) | Migrate to per-stream states. | +| 0.2.14 | 2022-04-12 | [11352](https://github.com/airbytehq/airbyte/pull/11352) | Update documentation | +| 0.2.13 | 2022-04-11 | [11632](https://github.com/airbytehq/airbyte/pull/11632) | Add unit tests | +| 0.2.12 | 2022-03-17 | [10975](https://github.com/airbytehq/airbyte/pull/10975) | Fix campaign's stream normalization | +| 0.2.11 | 2021-12-24 | [7159](https://github.com/airbytehq/airbyte/pull/7159) | Add oauth2.0 support | +| 0.2.10 | 2021-12-21 | [9000](https://github.com/airbytehq/airbyte/pull/9000) | Update connector fields title/description | +| 0.2.9 | 2021-12-13 | [7975](https://github.com/airbytehq/airbyte/pull/7975) | Updated JSON schemas | +| 0.2.8 | 2021-08-17 | [5481](https://github.com/airbytehq/airbyte/pull/5481) | Remove date-time type from some fields | +| 0.2.7 | 2021-08-03 | [5137](https://github.com/airbytehq/airbyte/pull/5137) | Source Mailchimp: fix primary key for email activities | +| 0.2.6 | 2021-07-28 | [5024](https://github.com/airbytehq/airbyte/pull/5024) | Source Mailchimp: handle records with no no "activity" field in response | +| 0.2.5 | 2021-07-08 | [4621](https://github.com/airbytehq/airbyte/pull/4621) | Mailchimp fix url-base | +| 0.2.4 | 2021-06-09 | [4285](https://github.com/airbytehq/airbyte/pull/4285) | Use datacenter URL parameter from apikey | +| 0.2.3 | 2021-06-08 | [3973](https://github.com/airbytehq/airbyte/pull/3973) | Add AIRBYTE\_ENTRYPOINT for Kubernetes support | +| 0.2.2 | 2021-06-08 | [3415](https://github.com/airbytehq/airbyte/pull/3415) | Get Members activities | +| 0.2.1 | 2021-04-03 | [2726](https://github.com/airbytehq/airbyte/pull/2726) | Fix base connector versioning | +| 0.2.0 | 2021-03-09 | [2238](https://github.com/airbytehq/airbyte/pull/2238) | Protocol allows future/unknown properties | +| 0.1.4 | 2020-11-30 | [1046](https://github.com/airbytehq/airbyte/pull/1046) | Add connectors using an index YAML file | From e894f2cef6f65c6aac8dffb23e644863f7c5e54c Mon Sep 17 00:00:00 2001 From: Octavia Squidington III Date: Mon, 9 Jan 2023 20:10:27 +0000 Subject: [PATCH 2/2] auto-bump connector version --- .../init/src/main/resources/seed/source_definitions.yaml | 2 +- .../init/src/main/resources/seed/source_specs.yaml | 6 +++++- .../connectors/source-mailchimp/source_mailchimp/source.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index 279d2d493b69..2cc6a4410c41 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -891,7 +891,7 @@ - name: Mailchimp sourceDefinitionId: b03a9f3e-22a5-11eb-adc1-0242ac120002 dockerRepository: airbyte/source-mailchimp - dockerImageTag: 0.3.0 + dockerImageTag: 0.3.1 documentationUrl: https://docs.airbyte.com/integrations/sources/mailchimp icon: mailchimp.svg sourceType: api diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index cfcdd1e7fe84..61cbf11961a4 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -7603,7 +7603,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-mailchimp:0.3.0" +- dockerImage: "airbyte/source-mailchimp:0.3.1" spec: documentationUrl: "https://docs.airbyte.com/integrations/sources/mailchimp" connectionSpecification: @@ -7659,6 +7659,10 @@ description: "Mailchimp API Key. See the docs for information on how to generate this key." airbyte_secret: true + campaign_id: + type: "string" + title: "ID of a campaign to sync email activities" + airbyte_hidden: true supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py index 1f1650a044af..6a2b3c6545f5 100644 --- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py +++ b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/source.py @@ -67,5 +67,5 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]: return [ Lists(authenticator=authenticator), Campaigns(authenticator=authenticator), - EmailActivity(authenticator=authenticator, campaign_id=campaign_id) + EmailActivity(authenticator=authenticator, campaign_id=campaign_id), ]