From bf38e8cfd112a673b4af5685385706197b22dcc5 Mon Sep 17 00:00:00 2001 From: Andy Lu Date: Thu, 16 Sep 2021 17:38:19 +0000 Subject: [PATCH] Revert Organizations to the Incremental Search endpoint --- tap_zendesk/streams.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tap_zendesk/streams.py b/tap_zendesk/streams.py index fa03a2c..97325a1 100644 --- a/tap_zendesk/streams.py +++ b/tap_zendesk/streams.py @@ -153,11 +153,10 @@ def _add_custom_fields(self, schema): def sync(self, state): bookmark = self.get_bookmark(state) - organizations = self.get_objects() + organizations = self.client.organizations.incremental(start_time=bookmark) for organization in organizations: - if utils.strptime_with_tz(organization['updated_at']) >= bookmark: - self.update_bookmark(state, organization['updated_at']) - yield (self.stream, organization) + self.update_bookmark(state, organization.updated_at) + yield (self.stream, organization) class Users(Stream):