Skip to content

Commit 21cb653

Browse files
committed
fix(domain): drop unused pytz dependency from dates utils
1 parent cc43991 commit 21cb653

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • investing_algorithm_framework/domain/utils

investing_algorithm_framework/domain/utils/dates.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from datetime import datetime
1+
from datetime import datetime, tzinfo
22
from typing import Optional
3-
import pytz
43

54

65
def is_timezone_aware(dt: datetime) -> bool:
@@ -16,15 +15,15 @@ def is_timezone_aware(dt: datetime) -> bool:
1615
return dt.tzinfo is not None and dt.tzinfo.utcoffset(dt) is not None
1716

1817

19-
def get_timezone(dt: datetime) -> Optional[pytz.tzinfo.BaseTzInfo]:
18+
def get_timezone(dt: datetime) -> Optional[tzinfo]:
2019
"""
2120
Returns the timezone info from a datetime object.
2221
2322
Args:
2423
dt (datetime): The datetime object to check.
2524
2625
Returns:
27-
pytz timezone info if available, otherwise None.
26+
tzinfo if available, otherwise None.
2827
"""
2928
if dt.tzinfo is not None and dt.tzinfo.utcoffset(dt) is not None:
3029
return dt.tzinfo

0 commit comments

Comments
 (0)