From c7dc5e11435f97056cd682cee04f2ccc15624b4f Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 14 Jul 2022 15:42:16 +0300 Subject: [PATCH] Source Freshsales: tune get_view_id function (#14705) * #12111 source freshsales: tune get_view_id function * auto-bump connector version Co-authored-by: Octavia Squidington III --- .../resources/seed/source_definitions.yaml | 2 +- .../src/main/resources/seed/source_specs.yaml | 2 +- .../connectors/source-freshsales/Dockerfile | 2 +- .../source_freshsales/source.py | 9 +++----- docs/integrations/sources/freshsales.md | 21 ++++++++++--------- 5 files changed, 17 insertions(+), 19 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 029fd20feb1d..fe11d2a56d29 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -287,7 +287,7 @@ - name: Freshsales sourceDefinitionId: eca08d79-7b92-4065-b7f3-79c14836ebe7 dockerRepository: airbyte/source-freshsales - dockerImageTag: 0.1.1 + dockerImageTag: 0.1.2 documentationUrl: https://docs.airbyte.io/integrations/sources/freshsales icon: freshsales.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 0d82714f0167..ed2dc18b78be 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -2536,7 +2536,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-freshsales:0.1.1" +- dockerImage: "airbyte/source-freshsales:0.1.2" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/freshsales" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-freshsales/Dockerfile b/airbyte-integrations/connectors/source-freshsales/Dockerfile index 0da75a653abc..79b4584b4253 100644 --- a/airbyte-integrations/connectors/source-freshsales/Dockerfile +++ b/airbyte-integrations/connectors/source-freshsales/Dockerfile @@ -34,5 +34,5 @@ COPY source_freshsales ./source_freshsales ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.1 +LABEL io.airbyte.version=0.1.2 LABEL io.airbyte.name=airbyte/source-freshsales diff --git a/airbyte-integrations/connectors/source-freshsales/source_freshsales/source.py b/airbyte-integrations/connectors/source-freshsales/source_freshsales/source.py index a81a27bf2039..cc1aa71c8b30 100644 --- a/airbyte-integrations/connectors/source-freshsales/source_freshsales/source.py +++ b/airbyte-integrations/connectors/source-freshsales/source_freshsales/source.py @@ -65,13 +65,10 @@ def _get_filters(self) -> List: def get_view_id(self): """ - This function iterate over all available filters and get the relevant filter_id. + This function finds a relevant filter_id among all available filters by its name. """ - if hasattr(self, "filter_name"): - filters = self._get_filters() - return next(filter["id"] for filter in filters if filter["name"] == self.filter_name) - else: - return + filters = self._get_filters() + return next(_filter["id"] for _filter in filters if _filter["name"] == self.filter_name) def path( self, stream_state: Mapping[str, Any] = None, stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None diff --git a/docs/integrations/sources/freshsales.md b/docs/integrations/sources/freshsales.md index 2f6a3e92187e..5949682ab055 100644 --- a/docs/integrations/sources/freshsales.md +++ b/docs/integrations/sources/freshsales.md @@ -22,12 +22,12 @@ If there are more endpoints you'd like Airbyte to support, please [create an iss ### Features -| Feature | Supported? | -| :--- | :--- | -| Full Refresh Sync | Yes | -| Incremental Sync | No | -| SSL connection | No | -| Namespaces | No | +| Feature | Supported? | +|:------------------|:-----------| +| Full Refresh Sync | Yes | +| Incremental Sync | No | +| SSL connection | No | +| Namespaces | No | ### Performance considerations @@ -47,7 +47,8 @@ Please read [How to find your API key](https://crmsupport.freshworks.com/support ## Changelog -| Version | Date | Pull Request | Subject | -| :--- | :--- | :--- | :--- | -| 0.1.1 | 2021-12-24 | [9101](https://github.com/airbytehq/airbyte/pull/9101) | Update fields and descriptions | -| 0.1.0 | 2021-11-03 | [6963](https://github.com/airbytehq/airbyte/pull/6963) | 🎉 New Source: Freshsales | +| Version | Date | Pull Request | Subject | +|:--------|:-----------|:---------------------------------------------------------|:--------------------------------| +| 0.1.2 | 2022-07-14 | [00000](https://github.com/airbytehq/airbyte/pull/00000) | Tune the `get_view_id` function | +| 0.1.1 | 2021-12-24 | [9101](https://github.com/airbytehq/airbyte/pull/9101) | Update fields and descriptions | +| 0.1.0 | 2021-11-03 | [6963](https://github.com/airbytehq/airbyte/pull/6963) | 🎉 New Source: Freshsales |