Skip to content

Commit 337e1fc

Browse files
authored
feat(source-zendesk-support): update CDK to v5 (#45187)
Signed-off-by: Artem Inzhyyants <[email protected]>
1 parent b5756b7 commit 337e1fc

File tree

11 files changed

+385
-310
lines changed

11 files changed

+385
-310
lines changed

airbyte-integrations/connectors/source-zendesk-support/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data:
1111
connectorSubtype: api
1212
connectorType: source
1313
definitionId: 79c1aa37-dae3-42ae-b333-d1c105477715
14-
dockerImageTag: 4.0.2
14+
dockerImageTag: 4.1.0
1515
dockerRepository: airbyte/source-zendesk-support
1616
documentationUrl: https://docs.airbyte.com/integrations/sources/zendesk-support
1717
githubIssueLabel: source-zendesk-support

airbyte-integrations/connectors/source-zendesk-support/poetry.lock

+257-182
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-integrations/connectors/source-zendesk-support/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
33
build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
6-
version = "4.0.2"
6+
version = "4.1.0"
77
name = "source-zendesk-support"
88
description = "Source implementation for Zendesk Support."
99
authors = [ "Airbyte <[email protected]>",]
@@ -17,7 +17,7 @@ include = "source_zendesk_support"
1717

1818
[tool.poetry.dependencies]
1919
python = "^3.10,<3.12"
20-
airbyte-cdk = "^4"
20+
airbyte-cdk = "^5"
2121
pytz = "==2024.1"
2222

2323
[tool.poetry.scripts]

airbyte-integrations/connectors/source-zendesk-support/source_zendesk_support/streams.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
import pytz
1515
import requests
1616
from airbyte_cdk import BackoffStrategy
17-
from airbyte_cdk.models import SyncMode
17+
from airbyte_cdk.models import FailureType, SyncMode
1818
from airbyte_cdk.sources.streams.core import StreamData, package_name_from_class
1919
from airbyte_cdk.sources.streams.http import HttpStream, HttpSubStream
2020
from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler, ErrorResolution, HttpStatusErrorHandler, ResponseAction
2121
from airbyte_cdk.sources.streams.http.error_handlers.default_error_mapping import DEFAULT_ERROR_MAPPING
2222
from airbyte_cdk.sources.utils.schema_helpers import ResourceSchemaLoader
2323
from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer
2424
from airbyte_cdk.utils import AirbyteTracedException
25-
from airbyte_protocol.models import FailureType
2625

2726
DATETIME_FORMAT: str = "%Y-%m-%dT%H:%M:%SZ"
2827
LAST_END_TIME_KEY: str = "_last_end_time"

airbyte-integrations/connectors/source-zendesk-support/unit_tests/integrations/test_post_comment_votes.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
import freezegun
88
import pendulum
9+
from airbyte_cdk.models import AirbyteStateBlob
10+
from airbyte_cdk.models import Level as LogLevel
11+
from airbyte_cdk.models import SyncMode
912
from airbyte_cdk.test.mock_http import HttpMocker
1013
from airbyte_cdk.test.mock_http.response_builder import FieldPath
1114
from airbyte_cdk.test.state_builder import StateBuilder
12-
from airbyte_protocol.models import AirbyteStateBlob
13-
from airbyte_protocol.models import Level as LogLevel
14-
from airbyte_protocol.models import SyncMode
1515

1616
from .config import ConfigBuilder
1717
from .helpers import given_post_comments, given_posts, given_ticket_forms
@@ -209,7 +209,7 @@ def test_given_no_state_and_successful_sync_when_read_then_set_state_to_now(self
209209
assert len(output.records) == 1
210210

211211
assert output.most_recent_state.stream_descriptor.name == "post_comment_votes"
212-
assert output.most_recent_state.stream_state == AirbyteStateBlob.model_validate({"updated_at": post_comment_votes["updated_at"]})
212+
assert output.most_recent_state.stream_state == AirbyteStateBlob({"updated_at": post_comment_votes["updated_at"]})
213213

214214
@HttpMocker()
215215
def test_given_state_and_pagination_when_read_then_return_records(self, http_mocker):
@@ -267,4 +267,4 @@ def test_given_state_and_pagination_when_read_then_return_records(self, http_moc
267267
assert len(output.records) == 2
268268

269269
assert output.most_recent_state.stream_descriptor.name == "post_comment_votes"
270-
assert output.most_recent_state.stream_state == AirbyteStateBlob.model_validate({"updated_at": datetime_to_string(last_page_record_updated_at)})
270+
assert output.most_recent_state.stream_state == AirbyteStateBlob({"updated_at": datetime_to_string(last_page_record_updated_at)})

airbyte-integrations/connectors/source-zendesk-support/unit_tests/integrations/test_post_comments.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
import freezegun
88
import pendulum
9+
from airbyte_cdk.models import AirbyteStateBlob
10+
from airbyte_cdk.models import Level as LogLevel
11+
from airbyte_cdk.models import SyncMode
912
from airbyte_cdk.test.mock_http import HttpMocker
1013
from airbyte_cdk.test.mock_http.response_builder import FieldPath
1114
from airbyte_cdk.test.state_builder import StateBuilder
12-
from airbyte_protocol.models import AirbyteStateBlob
13-
from airbyte_protocol.models import Level as LogLevel
14-
from airbyte_protocol.models import SyncMode
1515

1616
from .config import ConfigBuilder
1717
from .helpers import given_posts, given_ticket_forms
@@ -179,7 +179,7 @@ def test_given_no_state_and_successful_sync_when_read_then_set_state_to_now(self
179179

180180
post_comment = post_comments_record_builder.build()
181181
assert output.most_recent_state.stream_descriptor.name == "post_comments"
182-
assert output.most_recent_state.stream_state == AirbyteStateBlob.model_validate({"updated_at": post_comment["updated_at"]})
182+
assert output.most_recent_state.stream_state == AirbyteStateBlob({"updated_at": post_comment["updated_at"]})
183183

184184
@HttpMocker()
185185
def test_given_state_and_pagination_when_read_then_return_records(self, http_mocker):
@@ -234,4 +234,4 @@ def test_given_state_and_pagination_when_read_then_return_records(self, http_moc
234234
assert len(output.records) == 2
235235

236236
assert output.most_recent_state.stream_descriptor.name == "post_comments"
237-
assert output.most_recent_state.stream_state == AirbyteStateBlob.model_validate({"updated_at": datetime_to_string(last_page_record_updated_at)})
237+
assert output.most_recent_state.stream_state == AirbyteStateBlob({"updated_at": datetime_to_string(last_page_record_updated_at)})

airbyte-integrations/connectors/source-zendesk-support/unit_tests/integrations/test_post_votes.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
import freezegun
88
import pendulum
9+
from airbyte_cdk.models import AirbyteStateBlob
10+
from airbyte_cdk.models import Level as LogLevel
11+
from airbyte_cdk.models import SyncMode
912
from airbyte_cdk.test.mock_http import HttpMocker
1013
from airbyte_cdk.test.mock_http.response_builder import FieldPath
1114
from airbyte_cdk.test.state_builder import StateBuilder
12-
from airbyte_protocol.models import AirbyteStateBlob
13-
from airbyte_protocol.models import Level as LogLevel
14-
from airbyte_protocol.models import SyncMode
1515

1616
from .config import ConfigBuilder
1717
from .helpers import given_posts, given_ticket_forms
@@ -179,7 +179,7 @@ def test_given_no_state_and_successful_sync_when_read_then_set_state_to_now(self
179179

180180
post_comment = post_comments_record_builder.build()
181181
assert output.most_recent_state.stream_descriptor.name == "post_votes"
182-
assert output.most_recent_state.stream_state == AirbyteStateBlob.model_validate({"updated_at": post_comment["updated_at"]})
182+
assert output.most_recent_state.stream_state == AirbyteStateBlob({"updated_at": post_comment["updated_at"]})
183183

184184
@HttpMocker()
185185
def test_given_state_and_pagination_when_read_then_return_records(self, http_mocker):
@@ -231,4 +231,4 @@ def test_given_state_and_pagination_when_read_then_return_records(self, http_moc
231231
assert len(output.records) == 2
232232

233233
assert output.most_recent_state.stream_descriptor.name == "post_votes"
234-
assert output.most_recent_state.stream_state == AirbyteStateBlob.model_validate({"updated_at": datetime_to_string(last_page_record_updated_at)})
234+
assert output.most_recent_state.stream_state == AirbyteStateBlob({"updated_at": datetime_to_string(last_page_record_updated_at)})

airbyte-integrations/connectors/source-zendesk-support/unit_tests/integrations/test_ticket_metrics.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
import freezegun
77
import pendulum
8+
from airbyte_cdk.models import AirbyteStateBlob, SyncMode
89
from airbyte_cdk.test.mock_http import HttpMocker
910
from airbyte_cdk.test.mock_http.response_builder import FieldPath
1011
from airbyte_cdk.test.state_builder import StateBuilder
11-
from airbyte_protocol.models import AirbyteStateBlob, SyncMode
1212

1313
from .config import ConfigBuilder
1414
from .helpers import given_tickets, given_tickets_with_state
@@ -56,7 +56,7 @@ def test_given_no_state_and_successful_sync_when_read_then_set_state_to_most_rec
5656

5757
assert len(output.records) == 1
5858
assert output.most_recent_state.stream_descriptor.name == "ticket_metrics"
59-
assert output.most_recent_state.stream_state == AirbyteStateBlob.model_validate({
59+
assert output.most_recent_state.stream_state == AirbyteStateBlob({
6060
"generated_timestamp": ticket["generated_timestamp"]
6161
})
6262

@@ -84,6 +84,6 @@ def test_given_state_and_successful_sync_when_read_then_return_record(self, http
8484

8585
assert len(output.records) == 1
8686
assert output.most_recent_state.stream_descriptor.name == "ticket_metrics"
87-
assert output.most_recent_state.stream_state == AirbyteStateBlob.model_validate({
87+
assert output.most_recent_state.stream_state == AirbyteStateBlob({
8888
"generated_timestamp": record_cursor_value.int_timestamp
8989
})

airbyte-integrations/connectors/source-zendesk-support/unit_tests/integrations/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import pendulum
77
from airbyte_cdk.models import AirbyteMessage
88
from airbyte_cdk.models import Level as LogLevel
9+
from airbyte_cdk.models import SyncMode
910
from airbyte_cdk.test.catalog_builder import CatalogBuilder
1011
from airbyte_cdk.test.entrypoint_wrapper import EntrypointOutput, read
11-
from airbyte_protocol.models import SyncMode
1212
from pendulum.datetime import DateTime
1313
from source_zendesk_support import SourceZendeskSupport
1414

airbyte-integrations/connectors/source-zendesk-support/unit_tests/unit_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import pytest
1717
import pytz
1818
import requests
19+
from airbyte_cdk.models import SyncMode
1920
from airbyte_cdk.sources.streams.http.error_handlers import ResponseAction
20-
from airbyte_protocol.models import SyncMode
2121
from source_zendesk_support.source import BasicApiTokenAuthenticator, SourceZendeskSupport
2222
from source_zendesk_support.streams import (
2323
DATETIME_FORMAT,

0 commit comments

Comments
 (0)