From 654957f79b31f5331399b5e4d5885122fbe27f69 Mon Sep 17 00:00:00 2001 From: Vinicius Mesel Date: Fri, 17 Nov 2023 11:07:28 -0300 Subject: [PATCH] Changes datetime parser (#11) --- tap_hubspot_beta/streams.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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