Skip to content

Commit

Permalink
🐛 Source Zendesk-Support: fixed ticket_audits stream schema + fixed…
Browse files Browse the repository at this point in the history
… broken unit_test (#13055)
  • Loading branch information
bazarnov authored and suhomud committed May 23, 2022
1 parent c4e1bb2 commit 46207f7
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 4 deletions.
Expand Up @@ -986,7 +986,7 @@
- name: Zendesk Support
sourceDefinitionId: 79c1aa37-dae3-42ae-b333-d1c105477715
dockerRepository: airbyte/source-zendesk-support
dockerImageTag: 0.2.7
dockerImageTag: 0.2.8
documentationUrl: https://docs.airbyte.io/integrations/sources/zendesk-support
icon: zendesk.svg
sourceType: api
Expand Down
Expand Up @@ -9434,7 +9434,7 @@
path_in_connector_config:
- "credentials"
- "client_secret"
- dockerImage: "airbyte/source-zendesk-support:0.2.7"
- dockerImage: "airbyte/source-zendesk-support:0.2.8"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/zendesk-support"
connectionSpecification:
Expand Down
Expand Up @@ -25,5 +25,5 @@ COPY source_zendesk_support ./source_zendesk_support
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.2.7
LABEL io.airbyte.version=0.2.8
LABEL io.airbyte.name=airbyte/source-zendesk-support
Expand Up @@ -99,7 +99,7 @@
"type": ["null", "string"]
},
"call_duration": {
"type": ["null", "string"]
"type": ["null", "number"]
},
"answered_by_name": {
"type": ["null", "string"]
Expand Down
@@ -0,0 +1,42 @@
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#

import json
from typing import Any, Dict, Mapping

import requests
from source_zendesk_support.source import SourceZendeskSupport
from source_zendesk_support.streams import Users


def read_config(config_path: str) -> Mapping[str, Any]:
"""
Get the config from /test_input
"""
with open(config_path, "r") as f:
return json.loads(f.read())


def prepare_config(config: Dict):
return SourceZendeskSupport().convert_config2stream_args(config)


# create client
config = prepare_config(read_config("secrets/config.json"))
# test stream
TEST_STREAM = Users(**config)


def test_backoff(requests_mock):
""" """
test_response_header = {"Retry-After": "5", "X-Rate-Limit": "0"}
test_response_json = {"count": {"value": 1, "refreshed_at": "2022-03-29T10:10:51+00:00"}}
expected = int(test_response_header.get("Retry-After"))

url = f"{TEST_STREAM.url_base}{TEST_STREAM.path()}/count.json"
requests_mock.get(url, json=test_response_json, headers=test_response_header, status_code=429)
test_response = requests.get(url)

actual = TEST_STREAM.backoff_time(test_response)
assert actual == expected
1 change: 1 addition & 0 deletions docs/integrations/sources/zendesk-support.md
Expand Up @@ -74,6 +74,7 @@ The Zendesk connector should not run into Zendesk API limitations under normal u

| Version | Date | Pull Request | Subject |
|:---------|:-----------|:---------------------------------------------------------|:------------------------------------------------------------------------|
| `0.2.8` | 2022-05-20 | [13055](https://github.com/airbytehq/airbyte/pull/13055) | Fixed minor issue for stream `ticket_audits` schema |
| `0.2.7` | 2022-04-27 | [12335](https://github.com/airbytehq/airbyte/pull/12335) | Adding fixtures to mock time.sleep for connectors that explicitly sleep |
| `0.2.6` | 2022-04-19 | [12122](https://github.com/airbytehq/airbyte/pull/12122) | Fixed the bug when only 100,000 Users are synced [11895](https://github.com/airbytehq/airbyte/issues/11895) and fixed bug when `start_date` is not used on user stream [12059](https://github.com/airbytehq/airbyte/issues/12059).
| `0.2.5` | 2022-04-05 | [11727](https://github.com/airbytehq/airbyte/pull/11727) | Fixed the bug when state was not parsed correctly |
Expand Down

0 comments on commit 46207f7

Please sign in to comment.