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 e37555642c0bf..08005a94c05d6 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -399,7 +399,7 @@ - name: Harvest sourceDefinitionId: fe2b4084-3386-4d3b-9ad6-308f61a6f1e6 dockerRepository: airbyte/source-harvest - dockerImageTag: 0.1.9 + dockerImageTag: 0.1.10 documentationUrl: https://docs.airbyte.io/integrations/sources/harvest icon: harvest.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 d55013002ca33..59668684d0756 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -3547,7 +3547,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-harvest:0.1.9" +- dockerImage: "airbyte/source-harvest:0.1.10" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/harvest" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-harvest/Dockerfile b/airbyte-integrations/connectors/source-harvest/Dockerfile index 357777ca5bd70..cd03eb7f3907a 100644 --- a/airbyte-integrations/connectors/source-harvest/Dockerfile +++ b/airbyte-integrations/connectors/source-harvest/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.1.9 +LABEL io.airbyte.version=0.1.10 LABEL io.airbyte.name=airbyte/source-harvest diff --git a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/billable_rates.json b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/billable_rates.json index cc071925d0bab..c557775fd69f5 100644 --- a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/billable_rates.json +++ b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/billable_rates.json @@ -5,6 +5,9 @@ "id": { "type": ["null", "integer"] }, + "parent_id": { + "type": "integer" + }, "amount": { "type": ["null", "number"] }, diff --git a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/cost_rates.json b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/cost_rates.json index cc071925d0bab..c557775fd69f5 100644 --- a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/cost_rates.json +++ b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/cost_rates.json @@ -5,6 +5,9 @@ "id": { "type": ["null", "integer"] }, + "parent_id": { + "type": "integer" + }, "amount": { "type": ["null", "number"] }, diff --git a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/estimate_messages.json b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/estimate_messages.json index 28fbab6eaf43b..7d62b9f3ae378 100644 --- a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/estimate_messages.json +++ b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/estimate_messages.json @@ -5,6 +5,9 @@ "id": { "type": ["null", "integer"] }, + "parent_id": { + "type": "integer" + }, "sent_by": { "type": ["null", "string"] }, diff --git a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/invoice_messages.json b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/invoice_messages.json index f096b8c4a6862..1767ab4292de9 100644 --- a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/invoice_messages.json +++ b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/invoice_messages.json @@ -5,6 +5,9 @@ "id": { "type": ["null", "integer"] }, + "parent_id": { + "type": "integer" + }, "sent_by": { "type": ["null", "string"] }, diff --git a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/invoice_payments.json b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/invoice_payments.json index 7ab3a20b236aa..ddd2b46666a23 100644 --- a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/invoice_payments.json +++ b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/invoice_payments.json @@ -5,6 +5,9 @@ "id": { "type": ["null", "integer"] }, + "parent_id": { + "type": "integer" + }, "amount": { "type": ["null", "number"] }, diff --git a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/project_assignments.json b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/project_assignments.json index ae8710b066c11..3019b6ce51bb7 100644 --- a/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/project_assignments.json +++ b/airbyte-integrations/connectors/source-harvest/source_harvest/schemas/project_assignments.json @@ -5,6 +5,9 @@ "id": { "type": ["null", "integer"] }, + "parent_id": { + "type": "integer" + }, "is_project_manager": { "type": ["null", "boolean"] }, diff --git a/airbyte-integrations/connectors/source-harvest/source_harvest/streams.py b/airbyte-integrations/connectors/source-harvest/source_harvest/streams.py index dfc828a3abf9e..390bba2f0663e 100644 --- a/airbyte-integrations/connectors/source-harvest/source_harvest/streams.py +++ b/airbyte-integrations/connectors/source-harvest/source_harvest/streams.py @@ -101,7 +101,7 @@ def request_params( return params -class HarvestSubStream(HarvestStream): +class HarvestSubStream(HarvestStream, ABC): @property @abstractmethod def path_template(self) -> str: @@ -124,6 +124,11 @@ def stream_slices(self, **kwargs) -> Iterable[Optional[Mapping[str, any]]]: def path(self, stream_slice: Optional[Mapping[str, Any]] = None, **kwargs) -> str: return self.path_template.format(parent_id=stream_slice["parent_id"]) + def parse_response(self, response: requests.Response, stream_slice: Mapping[str, Any] = None, **kwargs) -> Iterable[Mapping]: + for record in super().parse_response(response, stream_slice=stream_slice, **kwargs): + record["parent_id"] = stream_slice["parent_id"] + yield record + class Contacts(IncrementalHarvestStream): """ diff --git a/docs/integrations/sources/harvest.md b/docs/integrations/sources/harvest.md index 95a78a3f6d273..5208b0dbcd673 100644 --- a/docs/integrations/sources/harvest.md +++ b/docs/integrations/sources/harvest.md @@ -84,6 +84,7 @@ The Harvest connector will gracefully handle rate limits. For more information, | Version | Date | Pull Request | Subject | | :--- | :--- | :--- | :--- | +| 0.1.10 | 2022-08-08 | [15221](https://github.com/airbytehq/airbyte/pull/15221) | Added `parent_id` for all streams which have parent stream | | 0.1.9 | 2022-08-04 | [15312](https://github.com/airbytehq/airbyte/pull/15312) | Fix `started_time` and `ended_time` format schema error and updated report slicing | | 0.1.8 | 2021-12-14 | [8429](https://github.com/airbytehq/airbyte/pull/8429) | Update titles and descriptions | | 0.1.6 | 2021-11-14 | [7952](https://github.com/airbytehq/airbyte/pull/7952) | Implement OAuth 2.0 support |