From fa07d34719a1415f2b8ceb2c8797b91317831b2e Mon Sep 17 00:00:00 2001 From: Anatolii Yatsuk Date: Fri, 22 Dec 2023 16:36:48 +0200 Subject: [PATCH] Fix pendulum version --- .../connectors/source-google-ads/setup.py | 4 +++- .../unit_tests/test_incremental_events_streams.py | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/airbyte-integrations/connectors/source-google-ads/setup.py b/airbyte-integrations/connectors/source-google-ads/setup.py index 45a16c4c036b..d0694f67fa7b 100644 --- a/airbyte-integrations/connectors/source-google-ads/setup.py +++ b/airbyte-integrations/connectors/source-google-ads/setup.py @@ -7,7 +7,9 @@ # pin protobuf==3.20.0 as other versions may cause problems on different architectures # (see https://github.com/airbytehq/airbyte/issues/13580) -MAIN_REQUIREMENTS = ["airbyte-cdk>=0.51.3", "google-ads==22.1.0", "protobuf", "pendulum>=3.0.0"] +# pendulum <3.0.0 is required to align with the CDK version, and should be updated once the next issue is resolved: +# https://github.com/airbytehq/airbyte/issues/33573 +MAIN_REQUIREMENTS = ["airbyte-cdk>=0.51.3", "google-ads==22.1.0", "protobuf", "pendulum<3.0.0"] TEST_REQUIREMENTS = ["pytest~=6.1", "pytest-mock", "freezegun", "requests-mock"] diff --git a/airbyte-integrations/connectors/source-google-ads/unit_tests/test_incremental_events_streams.py b/airbyte-integrations/connectors/source-google-ads/unit_tests/test_incremental_events_streams.py index 1e3e1ddda690..929d5f22f29c 100644 --- a/airbyte-integrations/connectors/source-google-ads/unit_tests/test_incremental_events_streams.py +++ b/airbyte-integrations/connectors/source-google-ads/unit_tests/test_incremental_events_streams.py @@ -512,7 +512,7 @@ def test_update_state_with_parent_state(mocker): # Set pendulum to return a consistent value now = pendulum.datetime(2023, 11, 2, 12, 53, 7) - pendulum.travel_to(now) + pendulum.set_test_now(now) # Call the _update_state method with the third stream_slice stream_slice_third = {"customer_id": "customer_id_3"} @@ -529,7 +529,7 @@ def test_update_state_with_parent_state(mocker): assert stream._state == expected_state_third_call # Reset the pendulum mock to its original state - pendulum.travel_back() + pendulum.set_test_now() def test_update_state_without_parent_state(mocker): @@ -537,14 +537,14 @@ def test_update_state_without_parent_state(mocker): Test the _update_state method when the parent_stream does not have a state. """ # Reset any previous mock state for pendulum - pendulum.travel_back() + pendulum.set_test_now() # Mock instance setup stream = CampaignCriterion(api=MagicMock(), customers=[]) # Mock pendulum call to return a consistent value now = pendulum.datetime(2023, 11, 2, 12, 53, 7) - pendulum.travel_to(now) + pendulum.set_test_now(now) # Call the _update_state method with the first stream_slice stream_slice_first = {"customer_id": "customer_id_1"} @@ -568,4 +568,4 @@ def test_update_state_without_parent_state(mocker): assert stream._state == expected_state_second_call # Reset the pendulum mock to its original state - pendulum.travel_back() + pendulum.set_test_now()