diff --git a/pyproject.toml b/pyproject.toml index bfae1cd..f203cae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tap-instagram" -version = "0.3.1" +version = "0.3.2" description = "`tap-instagram` is a Singer tap for Instagram, built with the Meltano SDK for Singer Taps." authors = ["Prratek Ramchandani"] keywords = [ diff --git a/tap_instagram/streams.py b/tap_instagram/streams.py index 972abb4..d52cd1f 100644 --- a/tap_instagram/streams.py +++ b/tap_instagram/streams.py @@ -482,11 +482,17 @@ def _fetch_time_based_pagination_range( Returns: DateTime objects for "since" and "until" """ - since = max(self.get_starting_timestamp(context), min_since) - window_end = min( - self.get_replication_key_signpost(context), - pendulum.instance(since).add(seconds=max_time_window.seconds), - ) + try: + since = max(self.get_starting_timestamp(context), min_since) + window_end = min( + self.get_replication_key_signpost(context), + pendulum.instance(since).add(seconds=max_time_window.seconds), + ) + # seeing cases where self.get_starting_timestamp() is null + # possibly related to target-bigquery pushing malformed state - https://gitlab.com/meltano/sdk/-/issues/300 + except TypeError: + since = min_since + window_end = pendulum.instance(since).add(seconds=max_time_window.seconds) until = min(window_end, max_until) return since, until