From a3db7297eab30cc738de075ff64e11475c4106d1 Mon Sep 17 00:00:00 2001 From: Artem Inzhyyants Date: Mon, 24 Oct 2022 19:48:22 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Source=20Freshdesk:=20fix=20?= =?UTF-8?q?test;=20update=20CDK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../connectors/source-freshdesk/Dockerfile | 2 +- .../connectors/source-freshdesk/setup.py | 2 +- .../unit_tests/test_streams.py | 26 ++++++++++--------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/airbyte-integrations/connectors/source-freshdesk/Dockerfile b/airbyte-integrations/connectors/source-freshdesk/Dockerfile index 8f5537ca25ad..2dca6351cb8d 100644 --- a/airbyte-integrations/connectors/source-freshdesk/Dockerfile +++ b/airbyte-integrations/connectors/source-freshdesk/Dockerfile @@ -34,5 +34,5 @@ COPY source_freshdesk ./source_freshdesk ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.3.6 +LABEL io.airbyte.version=0.3.7 LABEL io.airbyte.name=airbyte/source-freshdesk diff --git a/airbyte-integrations/connectors/source-freshdesk/setup.py b/airbyte-integrations/connectors/source-freshdesk/setup.py index 233deec4f97d..63a58239e622 100644 --- a/airbyte-integrations/connectors/source-freshdesk/setup.py +++ b/airbyte-integrations/connectors/source-freshdesk/setup.py @@ -6,7 +6,7 @@ from setuptools import find_packages, setup MAIN_REQUIREMENTS = [ - "airbyte-cdk~=0.1", + "airbyte-cdk", "backoff==1.10.0", "requests==2.25.1", "pendulum==2.1.2", diff --git a/airbyte-integrations/connectors/source-freshdesk/unit_tests/test_streams.py b/airbyte-integrations/connectors/source-freshdesk/unit_tests/test_streams.py index de704263bc3d..d0b8b899456a 100644 --- a/airbyte-integrations/connectors/source-freshdesk/unit_tests/test_streams.py +++ b/airbyte-integrations/connectors/source-freshdesk/unit_tests/test_streams.py @@ -4,6 +4,7 @@ import random from typing import Any, MutableMapping +from unittest.mock import patch, PropertyMock import pytest from airbyte_cdk.models import SyncMode @@ -125,18 +126,19 @@ def test_incremental(stream, resource, authenticator, config, requests_mock): highest_updated_at = "2022-04-25T22:00:00Z" other_updated_at = "2022-04-01T00:00:00Z" highest_index = random.randint(0, 24) - requests_mock.register_uri( - "GET", - f"/api/{resource}", - json=[{"id": x, "updated_at": highest_updated_at if x == highest_index else other_updated_at} for x in range(25)], - ) - - stream = stream(authenticator=authenticator, config=config) - records, state = _read_incremental(stream, {}) - - assert len(records) == 25 - assert "updated_at" in state - assert state["updated_at"] == highest_updated_at + with patch(f'source_freshdesk.streams.{stream.__name__}.use_cache', new_callable=PropertyMock, return_value=False): + requests_mock.register_uri( + "GET", + f"/api/{resource}", + json=[{"id": x, "updated_at": highest_updated_at if x == highest_index else other_updated_at} for x in range(25)], + ) + + stream = stream(authenticator=authenticator, config=config) + records, state = _read_incremental(stream, {}) + + assert len(records) == 25 + assert "updated_at" in state + assert state["updated_at"] == highest_updated_at @pytest.mark.parametrize( From ede49686ef3db1b047154c34e439d03605379f66 Mon Sep 17 00:00:00 2001 From: Artem Inzhyyants Date: Mon, 24 Oct 2022 23:25:18 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20Source=20FreshDesk:=20revert?= =?UTF-8?q?=20docker=20label;=20update=20CDK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- airbyte-integrations/connectors/source-freshdesk/Dockerfile | 2 +- airbyte-integrations/connectors/source-freshdesk/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airbyte-integrations/connectors/source-freshdesk/Dockerfile b/airbyte-integrations/connectors/source-freshdesk/Dockerfile index 2dca6351cb8d..8f5537ca25ad 100644 --- a/airbyte-integrations/connectors/source-freshdesk/Dockerfile +++ b/airbyte-integrations/connectors/source-freshdesk/Dockerfile @@ -34,5 +34,5 @@ COPY source_freshdesk ./source_freshdesk ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.3.7 +LABEL io.airbyte.version=0.3.6 LABEL io.airbyte.name=airbyte/source-freshdesk diff --git a/airbyte-integrations/connectors/source-freshdesk/setup.py b/airbyte-integrations/connectors/source-freshdesk/setup.py index 63a58239e622..08f586a268bd 100644 --- a/airbyte-integrations/connectors/source-freshdesk/setup.py +++ b/airbyte-integrations/connectors/source-freshdesk/setup.py @@ -6,7 +6,7 @@ from setuptools import find_packages, setup MAIN_REQUIREMENTS = [ - "airbyte-cdk", + "airbyte-cdk~=0.2", "backoff==1.10.0", "requests==2.25.1", "pendulum==2.1.2",