From 73d63825cda36fc2a8cbd608e1a067478aec6776 Mon Sep 17 00:00:00 2001 From: Alex Bair Date: Thu, 3 Oct 2024 11:31:39 -0400 Subject: [PATCH] source-zendesk-support: checkpoint `TicketMetricEvents` state after every 1000 documents Previously, `TicketMetricEvents` was only emitting documents and checkpointing state after reading all available documents from Zendesk Support. `TicketMetricEvents` can take multiple hours to backfill, and any task restarts during the backfill caused `TicketMetricEvents` to start over completely instead of picking back up where it left off before the restart. Setting `state_checkpoint_interval` tells `TickeMetricEvents` to checkpoint state & emit documents after every 1000 documents and allows the stream to pick up where it left off if it's interrupted during a backfill. --- source-zendesk-support/source_zendesk_support/streams.py | 1 + 1 file changed, 1 insertion(+) diff --git a/source-zendesk-support/source_zendesk_support/streams.py b/source-zendesk-support/source_zendesk_support/streams.py index ae486f41e..287cf8664 100644 --- a/source-zendesk-support/source_zendesk_support/streams.py +++ b/source-zendesk-support/source_zendesk_support/streams.py @@ -932,6 +932,7 @@ class TicketMetricEvents(SourceZendeskSupportCursorPaginationStream): TicketMetricEvents stream: https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_metric_events/ """ + state_checkpoint_interval = 1000 cursor_field = "time" page_size = 1000