diff --git a/tap_hubspot_beta/streams.py b/tap_hubspot_beta/streams.py index 2332c79..76a861d 100644 --- a/tap_hubspot_beta/streams.py +++ b/tap_hubspot_beta/streams.py @@ -20,6 +20,7 @@ import time import pytz from singer_sdk.helpers._state import log_sort_error +from pendulum import parse class AccountStream(hubspotV1Stream): """Account Stream""" @@ -909,9 +910,7 @@ def post_process(self, row, context): row = super().post_process(row, context) rep_key = self.get_starting_timestamp(context).replace(tzinfo=pytz.utc) - archived_at = datetime.strptime( - row['archivedAt'], "%Y-%m-%dT%H:%M:%S.%fZ" - ).replace(tzinfo=pytz.utc) + archived_at = parse(row['archivedAt']).replace(tzinfo=pytz.utc) if archived_at > rep_key: return row