Skip to content

Commit

Permalink
šŸ› Source Zendesk Support: fix missing ticket_id in ticket_comments stā€¦
Browse files Browse the repository at this point in the history
ā€¦ream (#7679)

* fix(zendesk): add ticket_id to ticket_comments

* test(zendesk): set ticket cursor_field far in future

* bump connector version

* doc

* run seed file

Co-authored-by: Marcos Marx <marcosmarxm@gmail.com>
  • Loading branch information
asyarif93 and marcosmarxm committed Nov 17, 2021
1 parent 36fb21d commit cd3afa7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sourceDefinitionId": "79c1aa37-dae3-42ae-b333-d1c105477715",
"name": "Zendesk Support",
"dockerRepository": "airbyte/source-zendesk-support",
"dockerImageTag": "0.1.4",
"dockerImageTag": "0.1.5",
"documentationUrl": "https://docs.airbyte.io/integrations/sources/zendesk-support",
"icon": "zendesk.svg"
}
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@
- name: Zendesk Support
sourceDefinitionId: 79c1aa37-dae3-42ae-b333-d1c105477715
dockerRepository: airbyte/source-zendesk-support
dockerImageTag: 0.1.4
dockerImageTag: 0.1.5
documentationUrl: https://docs.airbyte.io/integrations/sources/zendesk-support
icon: zendesk.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5980,7 +5980,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-zendesk-support:0.1.4"
- dockerImage: "airbyte/source-zendesk-support:0.1.5"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/zendesk-support"
connectionSpecification:
Expand Down
Original file line number Diff line number Diff line change
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.1.4
LABEL io.airbyte.version=0.1.5
LABEL io.airbyte.name=airbyte/source-zendesk-support
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,12 @@ def parse_response(
) -> Iterable[Mapping]:
"""Handle response status"""
if response.status_code == 200:
yield from super().parse_response(response, stream_state=stream_state, stream_slice=stream_slice, **kwargs)
# Ticket ID not included in ticket comments response.
# Manually add ticket_id to ticket_comments dict.
ticket_id = stream_slice["id"]
result = super().parse_response(response, stream_state=stream_state, stream_slice=stream_slice, **kwargs)
enriched_result = map(lambda x: x.update({"ticket_id": ticket_id}) or x, result)
yield from enriched_result
elif response.status_code == 404:
ticket_id = stream_slice["id"]
# skip 404 errors for not found tickets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_comments_not_found_ticket(prepare_stream_args, status_code, expected_co
"comments": [
{
"id": fake_id,
TicketComments.cursor_field: "2021-07-22T06:55:55Z",
TicketComments.cursor_field: "2121-07-22T06:55:55Z",
}
]
},
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/zendesk-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ We recommend creating a restricted, read-only key specifically for Airbyte acces

| Version | Date | Pull Request | Subject |
| :------ | :-------- | :----- | :------ |
| `0.1.5` | 2021-10-26 | [7679](https://github.com/airbytehq/airbyte/pull/7679) | Add ticket_id and ticket_comments |
| `0.1.4` | 2021-10-26 | [7377](https://github.com/airbytehq/airbyte/pull/7377) | fix initially_assigned_at type in ticket metrics |
| `0.1.3` | 2021-10-17 | [7097](https://github.com/airbytehq/airbyte/pull/7097) | correction of spec file |
| `0.1.2` | 2021-10-16 | [6513](https://github.com/airbytehq/airbyte/pull/6513) | fixed comments stream |
Expand Down

0 comments on commit cd3afa7

Please sign in to comment.