From 8c89b7fcd88f223dabfcabb30fca788d7e05ccb5 Mon Sep 17 00:00:00 2001 From: Marcos Marx Date: Thu, 24 Feb 2022 15:44:04 -0300 Subject: [PATCH] :tada: add associations companies to deals, ticket and contacts stream (from PR 9027) (#10631) * Added associations to some CRM Object streams in Hubspot connector * Added associations in the relevant schemas * fix eof * bump connector version Co-authored-by: ksoenandar --- .../init/src/main/resources/seed/source_definitions.yaml | 2 +- .../init/src/main/resources/seed/source_specs.yaml | 2 +- airbyte-integrations/connectors/source-hubspot/Dockerfile | 2 +- .../source-hubspot/source_hubspot/schemas/contacts.json | 6 ++++++ .../source-hubspot/source_hubspot/schemas/deals.json | 2 +- .../source-hubspot/source_hubspot/schemas/tickets.json | 6 ++++++ .../connectors/source-hubspot/source_hubspot/streams.py | 6 +++--- docs/integrations/sources/hubspot.md | 1 + 8 files changed, 20 insertions(+), 7 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 6625eb483708..3b34e8d702d8 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -328,7 +328,7 @@ - name: HubSpot sourceDefinitionId: 36c891d9-4bd9-43ac-bad2-10e12756272c dockerRepository: airbyte/source-hubspot - dockerImageTag: 0.1.43 + dockerImageTag: 0.1.44 documentationUrl: https://docs.airbyte.io/integrations/sources/hubspot icon: hubspot.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 e39eb90d64f0..6044c5d3e3a3 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -3281,7 +3281,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-hubspot:0.1.43" +- dockerImage: "airbyte/source-hubspot:0.1.44" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/hubspot" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-hubspot/Dockerfile b/airbyte-integrations/connectors/source-hubspot/Dockerfile index 940b1bf206aa..50f8afaa15ec 100644 --- a/airbyte-integrations/connectors/source-hubspot/Dockerfile +++ b/airbyte-integrations/connectors/source-hubspot/Dockerfile @@ -34,5 +34,5 @@ COPY source_hubspot ./source_hubspot ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.43 +LABEL io.airbyte.version=0.1.44 LABEL io.airbyte.name=airbyte/source-hubspot diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/contacts.json b/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/contacts.json index 1459718fe844..d39af3e502b2 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/contacts.json +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/contacts.json @@ -15,6 +15,12 @@ }, "archived": { "type": ["null", "boolean"] + }, + "companies": { + "type": ["null", "array"], + "items": { + "type": ["null", "string"] + } } } } diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/deals.json b/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/deals.json index 076bd3763931..655f9a5df681 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/deals.json +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/deals.json @@ -344,7 +344,7 @@ "companies": { "type": ["null", "array"], "items": { - "type": ["null", "integer"] + "type": ["null", "string"] } }, "contacts": { diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/tickets.json b/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/tickets.json index 2b1d9b138ced..324d198e7ade 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/tickets.json +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/schemas/tickets.json @@ -22,6 +22,12 @@ "type": ["null", "integer"] } }, + "companies": { + "type": ["null", "array"], + "items": { + "type": ["null", "string"] + } + }, "deals": { "type": ["null", "array"], "items": { diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py index 134fe5514135..cac21f64ec38 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py @@ -1029,7 +1029,7 @@ class Deals(CRMSearchStream): entity = "deal" last_modified_field = "hs_lastmodifieddate" - associations = ["contacts"] + associations = ["contacts", "companies"] def __init__(self, **kwargs): super().__init__(**kwargs) @@ -1288,7 +1288,7 @@ class Companies(CRMSearchStream): class Contacts(CRMSearchStream): entity = "contact" last_modified_field = "lastmodifieddate" - associations = ["contacts"] + associations = ["contacts", "companies"] class EngagementsCalls(CRMSearchStream): @@ -1336,7 +1336,7 @@ class Products(CRMObjectIncrementalStream): class Tickets(CRMObjectIncrementalStream): entity = "ticket" - associations = ["contacts", "deals"] + associations = ["contacts", "deals", "companies"] class Quotes(CRMObjectIncrementalStream): diff --git a/docs/integrations/sources/hubspot.md b/docs/integrations/sources/hubspot.md index 4ba176b4e04f..ef8416ad18da 100644 --- a/docs/integrations/sources/hubspot.md +++ b/docs/integrations/sources/hubspot.md @@ -112,6 +112,7 @@ If you are using Oauth, most of the streams require the appropriate [scopes](htt | Version | Date | Pull Request | Subject | |:--------|:-----------| :--- |:-----------------------------------------------------------------------------------------------------------------------------------------------| +| 0.1.44 | 2022-02-24 | [9027](https://github.com/airbytehq/airbyte/pull/9027) | Add associations companies to deals, ticket and contact stream | | 0.1.43 | 2022-02-24 | [10576](https://github.com/airbytehq/airbyte/pull/10576) | Cast timestamp to date/datetime| | 0.1.42 | 2022-02-22 | [10492](https://github.com/airbytehq/airbyte/pull/10492) | Add `date-time` format to datetime fields| | 0.1.41 | 2022-02-21 | [10177](https://github.com/airbytehq/airbyte/pull/10177) | Migrate to CDK |