Skip to content

Commit

Permalink
Fix pendulum version
Browse files Browse the repository at this point in the history
  • Loading branch information
tolik0 committed Dec 22, 2023
1 parent d56a474 commit fa07d34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion airbyte-integrations/connectors/source-google-ads/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -529,22 +529,22 @@ 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):
"""
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"}
Expand All @@ -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()

0 comments on commit fa07d34

Please sign in to comment.