From 67f773a2accabe4a79f587f8742e0ea125b00d4c Mon Sep 17 00:00:00 2001 From: pandashark Date: Sat, 14 Feb 2026 05:54:50 -0600 Subject: [PATCH] BUG: Fix DataPortal correctness bugs - Fix _first_trading_minute set to (None, None) instead of None - Fix _get_daily_spot_value passing "minute" instead of "daily" to get_adjusted_value --- docs/source/whatsnew/skeleton.txt | 5 ++++- src/zipline/data/data_portal.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/source/whatsnew/skeleton.txt b/docs/source/whatsnew/skeleton.txt index abb397d893..6c94dbdcc7 100644 --- a/docs/source/whatsnew/skeleton.txt +++ b/docs/source/whatsnew/skeleton.txt @@ -31,7 +31,10 @@ None Bug Fixes ~~~~~~~~~ -None +- Fix ``DataPortal._first_trading_minute`` set to ``(None, None)`` tuple instead + of ``None`` when no first trading day is configured (:issue:`xxx`). +- Fix ``DataPortal._get_daily_spot_value`` passing ``"minute"`` instead of + ``"daily"`` as data frequency to ``get_adjusted_value`` (:issue:`xxx`). Performance ~~~~~~~~~~~ diff --git a/src/zipline/data/data_portal.py b/src/zipline/data/data_portal.py index bb317b1b78..ec11a54ed7 100644 --- a/src/zipline/data/data_portal.py +++ b/src/zipline/data/data_portal.py @@ -273,7 +273,7 @@ def __init__( self._first_trading_minute = ( self.trading_calendar.session_first_minute(self._first_trading_day) if self._first_trading_day is not None - else (None, None) + else None ) # Store the locs of the first day and first minute @@ -734,7 +734,7 @@ def _get_daily_spot_value(self, asset, column, dt): else: # adjust if needed return self.get_adjusted_value( - asset, column, found_dt, dt, "minute", spot_value=value + asset, column, found_dt, dt, "daily", spot_value=value ) else: found_dt -= self.trading_calendar.day