Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Zendesk Support: handle 400 error for tickets stream #23246

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,7 @@
- name: Zendesk Support
sourceDefinitionId: 79c1aa37-dae3-42ae-b333-d1c105477715
dockerRepository: airbyte/source-zendesk-support
dockerImageTag: 0.2.23
dockerImageTag: 0.2.24
documentationUrl: https://docs.airbyte.com/integrations/sources/zendesk-support
icon: zendesk-support.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16503,7 +16503,7 @@
path_in_connector_config:
- "credentials"
- "client_secret"
- dockerImage: "airbyte/source-zendesk-support:0.2.23"
- dockerImage: "airbyte/source-zendesk-support:0.2.24"
spec:
documentationUrl: "https://docs.airbyte.com/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.2.23
LABEL io.airbyte.version=0.2.24
LABEL io.airbyte.name=airbyte/source-zendesk-support
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ acceptance_tests:
- config_path: "secrets/config.json"
expect_records:
path: "integration_tests/expected_records.jsonl"
extra_fields: no
exact_order: no
extra_records: yes
incremental:
tests:
- config_path: "secrets/config.json"
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,14 @@ class Tickets(SourceZendeskIncrementalExportStream):
response_list_name: str = "tickets"
transformer: TypeTransformer = TypeTransformer(TransformConfig.DefaultSchemaNormalization)

@staticmethod
def check_start_time_param(requested_start_time: int, value: int = 1):
"""
The stream returns 400 Bad Request StartTimeTooRecent when requesting tasks 1 second before now.
Figured out during experiments that the most recent time needed for request to be successful is 3 seconds before now.
"""
return SourceZendeskIncrementalExportStream.check_start_time_param(requested_start_time, value=3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a description why the value is 3 minutes lookback instead of 1? This will help the devs maintain this class in case there is a change made to check_start_time_param

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Added description



class TicketComments(SourceZendeskSupportTicketEventsExportStream):
"""
Expand Down
2 changes: 1 addition & 1 deletion connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
| **Zendesk Chat** | <img alt="Zendesk Chat icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-chat.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-chat:0.1.12 | generally_available | [link](https://docs.airbyte.com/integrations/sources/zendesk-chat) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-chat) | <small>`40d24d0f-b8f9-4fe0-9e6c-b06c0f3f45e4`</small> |
| **Zendesk Sell** | <img alt="Zendesk Sell icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-sell:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/zendesk-sell) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-sell) | <small>`982eaa4c-bba1-4cce-a971-06a41f700b8c`</small> |
| **Zendesk Sunshine** | <img alt="Zendesk Sunshine icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-sunshine.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-sunshine:0.1.1 | alpha | [link](https://docs.airbyte.com/integrations/sources/zendesk-sunshine) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-sunshine) | <small>`325e0640-e7b3-4e24-b823-3361008f603f`</small> |
| **Zendesk Support** | <img alt="Zendesk Support icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-support.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-support:0.2.23 | generally_available | [link](https://docs.airbyte.com/integrations/sources/zendesk-support) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-support) | <small>`79c1aa37-dae3-42ae-b333-d1c105477715`</small> |
| **Zendesk Support** | <img alt="Zendesk Support icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-support.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-support:0.2.24 | generally_available | [link](https://docs.airbyte.com/integrations/sources/zendesk-support) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-support) | <small>`79c1aa37-dae3-42ae-b333-d1c105477715`</small> |
| **Zendesk Talk** | <img alt="Zendesk Talk icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zendesk-talk.svg" height="30" height="30"/> | Source | airbyte/source-zendesk-talk:0.1.6 | generally_available | [link](https://docs.airbyte.com/integrations/sources/zendesk-talk) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zendesk-talk) | <small>`c8630570-086d-4a40-99ae-ea5b18673071`</small> |
| **Zenefits** | <img alt="Zenefits icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zenefits.svg" height="30" height="30"/> | Source | airbyte/source-zenefits:0.1.0 | alpha | [link](https://docs.airbyte.com/integrations/sources/zenefits) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zenefits) | <small>`8baba53d-2fe3-4e33-bc85-210d0eb62884`</small> |
| **Zenloop** | <img alt="Zenloop icon" src="https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-config/init/src/main/resources/icons/zenloop.svg" height="30" height="30"/> | Source | airbyte/source-zenloop:0.1.5 | beta | [link](https://docs.airbyte.com/integrations/sources/zenloop) | [code](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-zenloop) | <small>`f1e4c7f6-db5c-4035-981f-d35ab4998794`</small> |
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 @@ -60,6 +60,7 @@ The Zendesk connector ideally should not run into Zendesk API limitations under

| Version | Date | Pull Request | Subject |
|:---------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `0.2.24` | 2023-02-17 | [23246](https://github.com/airbytehq/airbyte/pull/23246) | Handle `StartTimeTooRecent` error for Tickets stream |
| `0.2.23` | 2023-02-15 | [23035](https://github.com/airbytehq/airbyte/pull/23035) | Handle 403 Error |
| `0.2.22` | 2023-02-14 | [22483](https://github.com/airbytehq/airbyte/pull/22483) | Fix test; handle 400 error |
| `0.2.21` | 2023-01-27 | [22027](https://github.com/airbytehq/airbyte/pull/22027) | Set `AvailabilityStrategy` for streams explicitly to `None` |
Expand Down