Skip to content

Commit

Permalink
Skip record traversal if there is no iterable (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
viktigpetterr authored Nov 24, 2023
1 parent a5fcfbb commit 578a4df
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tap_intercom/intercom.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,10 @@ def search(self, tap_stream_id, start_date, end_date):
response_data = self.call_search_api(url, json=json)
if response_data:
records = self.get_value(response_data, [data_field])
for record in records:
replication_value = self.get_value(record, replication_path)
yield record, self.unixseconds_to_datetime(replication_value)
if records:
for record in records:
replication_value = self.get_value(record, replication_path)
yield record, self.unixseconds_to_datetime(replication_value)
pagination = self.get_value(response_data, pagination_path)
if not pagination or pagination == "null":
return
Expand Down

0 comments on commit 578a4df

Please sign in to comment.