Skip to content

Commit 3c11040

Browse files
committed
Ensure that portfolio snapshots are created with utc timezone
1 parent dc083d3 commit 3c11040

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ def from_dict(data):
182182
"""
183183
created_at_str = data.get("created_at")
184184
created_at = parser.parse(created_at_str)
185+
186+
# Ensure created_at is timezone aware
187+
created_at.replace(tzinfo=timezone.utc)
188+
185189
return PortfolioSnapshot(
186190
net_size=data.get("net_size", 0.0),
187191
created_at=created_at,

0 commit comments

Comments
 (0)