diff --git a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/b03a9f3e-22a5-11eb-adc1-0242ac120002.json b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/b03a9f3e-22a5-11eb-adc1-0242ac120002.json index abec823204a17..6482afbba6149 100644 --- a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/b03a9f3e-22a5-11eb-adc1-0242ac120002.json +++ b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/b03a9f3e-22a5-11eb-adc1-0242ac120002.json @@ -2,7 +2,7 @@ "sourceDefinitionId": "b03a9f3e-22a5-11eb-adc1-0242ac120002", "name": "Mailchimp", "dockerRepository": "airbyte/source-mailchimp", - "dockerImageTag": "0.2.5", + "dockerImageTag": "0.2.6", "documentationUrl": "https://hub.docker.com/r/airbyte/source-mailchimp", "icon": "mailchimp.svg" } 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 f6201e853c116..fcb7d5e53754c 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -109,7 +109,7 @@ - sourceDefinitionId: b03a9f3e-22a5-11eb-adc1-0242ac120002 name: Mailchimp dockerRepository: airbyte/source-mailchimp - dockerImageTag: 0.2.5 + dockerImageTag: 0.2.6 documentationUrl: https://hub.docker.com/r/airbyte/source-mailchimp icon: mailchimp.svg - sourceDefinitionId: 39f092a6-8c87-4f6f-a8d9-5cef45b7dbe1 diff --git a/airbyte-integrations/connectors/source-mailchimp/Dockerfile b/airbyte-integrations/connectors/source-mailchimp/Dockerfile index 2b71941df2d21..0ac44d8e15a4a 100644 --- a/airbyte-integrations/connectors/source-mailchimp/Dockerfile +++ b/airbyte-integrations/connectors/source-mailchimp/Dockerfile @@ -12,5 +12,5 @@ RUN pip install . ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.2.5 +LABEL io.airbyte.version=0.2.6 LABEL io.airbyte.name=airbyte/source-mailchimp diff --git a/airbyte-integrations/connectors/source-mailchimp/integration_tests/integration_test.py b/airbyte-integrations/connectors/source-mailchimp/integration_tests/integration_test.py new file mode 100644 index 0000000000000..b8a8150b507fd --- /dev/null +++ b/airbyte-integrations/connectors/source-mailchimp/integration_tests/integration_test.py @@ -0,0 +1,27 @@ +# +# MIT License +# +# Copyright (c) 2020 Airbyte +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + + +def test_example_method(): + assert True diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/schemas/email_activity.json b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/schemas/email_activity.json index af93cb761c0ba..2df5a6f1a0100 100644 --- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/schemas/email_activity.json +++ b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/schemas/email_activity.json @@ -29,30 +29,30 @@ "description": "Email address for a subscriber." }, "action": { - "type": "string", + "type": ["string", "null"], "title": "action", "enum": ["open", "click", "bounce"], "description": "One of the following actions: 'open', 'click', or 'bounce'" }, "type": { - "type": "string", + "type": ["string", "null"], "title": "Type", "enum": ["hard", "soft"], "description": "If the action is a 'bounce', the type of bounce received: 'hard', 'soft'." }, "timestamp": { - "type": "string", + "type": ["string", "null"], "title": "Action date and time", "description": "The date and time recorded for the action in ISO 8601 format.", "format": "date-time" }, "url": { - "type": "string", + "type": ["string", "null"], "title": "The IP address.", "description": "The IP address recorded for the action." }, "ip": { - "type": "string", + "type": ["string", "null"], "title": "Action ip address", "description": "The IP address recorded for the action." } diff --git a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py index b49303ba4169d..6491a3c93b87f 100644 --- a/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py +++ b/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/streams.py @@ -177,8 +177,5 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp # -> [[{'campaign_id', 'list_id', 'list_is_active', 'email_id', 'email_address', '**activity[i]', '_links'}, ...]] data = response_json[self.data_field] for item in data: - for activity_record in item["activity"]: - new_record = {k: v for k, v in item.items() if k != "activity"} - for k, v in activity_record.items(): - new_record[k] = v - yield new_record + for activity_item in item.pop("activity", []): + yield {**item, **activity_item} diff --git a/docs/integrations/sources/mailchimp.md b/docs/integrations/sources/mailchimp.md index 6432cc6c4bdea..3e3750937ade7 100644 --- a/docs/integrations/sources/mailchimp.md +++ b/docs/integrations/sources/mailchimp.md @@ -50,6 +50,7 @@ To start syncing Mailchimp data with Airbyte, you'll need two things: | Version | Date | Pull Request | Subject | | :------ | :-------- | :----- | :------ | +| 0.2.5 | 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 |