From 0c079e20c8756f7128974092ad2c8fe2f15780d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Wed, 21 Aug 2024 19:29:08 -0600 Subject: [PATCH] refactor: Default to UTC when parsing dates without a known timezone (#2619) --- singer_sdk/streams/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/singer_sdk/streams/core.py b/singer_sdk/streams/core.py index 739c254d8..51a968313 100644 --- a/singer_sdk/streams/core.py +++ b/singer_sdk/streams/core.py @@ -378,7 +378,7 @@ def _parse_datetime(self, value: str) -> datetime.datetime: # noqa: PLR6301 # Ensure datetime is timezone-aware if not result.tzinfo: - result = result.astimezone() + result = result.replace(tzinfo=datetime.timezone.utc) return result