From eb67c3a627ad4e66b5731d05b05c10c6be6feafb Mon Sep 17 00:00:00 2001 From: bhargavaram krishnapur <132352169+Codex-Crusader@users.noreply.github.com> Date: Fri, 5 Jun 2026 10:51:11 +0530 Subject: [PATCH] fix(price): use UTC-aware datetime for fetch window boundaries --- pulseengine/core/price.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulseengine/core/price.py b/pulseengine/core/price.py index ad0d6ae..6546671 100644 --- a/pulseengine/core/price.py +++ b/pulseengine/core/price.py @@ -54,7 +54,7 @@ def fetch_price_history( Returns None when the market simply has no data for the requested window. Raises DataFetchError when the fetch itself fails after retries. """ - end = dt.datetime.now(dt.timezone.utc) + end = dt.datetime.now(dt.UTC) start = end - dt.timedelta(days=days) last_error: Exception | None = None @@ -121,7 +121,7 @@ def _fetch_via_ticker_history(ticker: str, days: int) -> pd.DataFrame | None: for anything else. """ try: - end = dt.datetime.now(dt.timezone.utc) + end = dt.datetime.now(dt.UTC) start = end - dt.timedelta(days=days) with _yf_semaphore: data = yf.Ticker(ticker).history(