From af108b8238a398e507ca430ee93ea13738c1bd26 Mon Sep 17 00:00:00 2001 From: Jacob Baca Date: Thu, 17 Sep 2020 15:10:17 +0000 Subject: [PATCH 1/2] added error message, bumped version to 1.5.1 --- CHANGELOG.md | 3 +++ setup.py | 2 +- tap_zendesk/streams.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2596e96..8e11ead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.5.1 + * Add error message to go along with assert + ## 1.5.0 * Add date windowing to users stream and satisfaction ratings stream [#42](https://github.com/singer-io/tap-zendesk/pull/42) diff --git a/setup.py b/setup.py index e7d6399..76cf13a 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup(name='tap-zendesk', - version='1.5.0', + version='1.5.1', description='Singer.io tap for extracting data from the Zendesk API', author='Stitch', url='https://singer.io', diff --git a/tap_zendesk/streams.py b/tap_zendesk/streams.py index 296e838..7d9cae5 100644 --- a/tap_zendesk/streams.py +++ b/tap_zendesk/streams.py @@ -376,7 +376,7 @@ def sync(self, state): LOGGER.info("Detected Search API response size for this window is too large (> 50k). Cutting search window in half to %s seconds.", search_window_size) continue for satisfaction_rating in satisfaction_ratings: - assert parsed_start <= satisfaction_rating.updated_at + assert parsed_start <= satisfaction_rating.updated_at, "{} is not less than or equal to {}".format(parsed_start, satisfaction_rating.updated_at) if bookmark < utils.strptime_with_tz(satisfaction_rating.updated_at) <= end: # NB: We don't trust that the records come back ordered by # updated_at (we've observed out-of-order records), From 579d0bbdf0ad2eb2673d1b6c1ab17fcb57fd895a Mon Sep 17 00:00:00 2001 From: Jacob Baca Date: Thu, 17 Sep 2020 15:31:47 +0000 Subject: [PATCH 2/2] Improve error message with stream and info --- tap_zendesk/streams.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tap_zendesk/streams.py b/tap_zendesk/streams.py index 7d9cae5..ffd7c0d 100644 --- a/tap_zendesk/streams.py +++ b/tap_zendesk/streams.py @@ -185,7 +185,7 @@ def sync(self, state): LOGGER.info("Detected Search API response size too large. Cutting search window in half to %s seconds.", search_window_size) continue for user in users: - assert parsed_start <= user.updated_at, "{} is not less than or equal to {}".format(parsed_start, user.updated_at) + assert parsed_start <= user.updated_at, "users - Record found before date window start. Details: window start ({}) is not less than or equal to updated_at ({})".format(parsed_start, user.updated_at) if bookmark < utils.strptime_with_tz(user.updated_at) <= end: # NB: We don't trust that the records come back ordered by # updated_at (we've observed out-of-order records), @@ -376,7 +376,7 @@ def sync(self, state): LOGGER.info("Detected Search API response size for this window is too large (> 50k). Cutting search window in half to %s seconds.", search_window_size) continue for satisfaction_rating in satisfaction_ratings: - assert parsed_start <= satisfaction_rating.updated_at, "{} is not less than or equal to {}".format(parsed_start, satisfaction_rating.updated_at) + assert parsed_start <= satisfaction_rating.updated_at, "satisfaction_ratings - Record found before date window start. Details: window start ({}) is not less than or equal to updated_at ({})".format(parsed_start, satisfaction_rating.updated_at) if bookmark < utils.strptime_with_tz(satisfaction_rating.updated_at) <= end: # NB: We don't trust that the records come back ordered by # updated_at (we've observed out-of-order records),