From 5d35199148aaf1137e258c684df210cb4ef11455 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Mon, 6 Jan 2025 19:40:53 -0800 Subject: [PATCH] more linting --- .../tiingo/openbb_tiingo/models/websocket_connection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openbb_platform/providers/tiingo/openbb_tiingo/models/websocket_connection.py b/openbb_platform/providers/tiingo/openbb_tiingo/models/websocket_connection.py index 989999e77747..c70035e45e34 100644 --- a/openbb_platform/providers/tiingo/openbb_tiingo/models/websocket_connection.py +++ b/openbb_platform/providers/tiingo/openbb_tiingo/models/websocket_connection.py @@ -184,21 +184,21 @@ def _valiidate_data_type(cls, v): def _validate_date(cls, v): """Validate the date.""" # pylint: disable=import-outside-toplevel - from pandas import to_datetime - from pytz import timezone + from pandas import to_datetime # noqa + from pytz import timezone, UTC if isinstance(v, str): dt = to_datetime(v, utc=True).tz_convert(timezone("America/New_York")) else: try: - dt = datetime.fromtimestamp(v / 1000, timezone.utc) + dt = datetime.fromtimestamp(v / 1000, UTC) dt = dt.astimezone(timezone("America/New_York")) except Exception: if isinstance(v, (int, float)): # Check if the timestamp is in nanoseconds and convert to seconds if v > 1e12: v = v / 1e9 # Convert nanoseconds to seconds - dt = datetime.fromtimestamp(v, timezone.utc) + dt = datetime.fromtimestamp(v, UTC) dt = dt.astimezone(timezone("America/New_York")) else: dt = v