From 1203b25cb125451c7b123aafbb51dc2b8d731c41 Mon Sep 17 00:00:00 2001 From: Kyle Widmann Date: Thu, 13 Feb 2025 21:22:15 -0500 Subject: [PATCH] Fix return type for data context next --- pytrade/data.py | 3 ++- pytrade/interfaces/data.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pytrade/data.py b/pytrade/data.py index ee9cb6a..86c4def 100644 --- a/pytrade/data.py +++ b/pytrade/data.py @@ -139,6 +139,7 @@ def update(self, candle: Candlestick): instrument_candles.update(candle) self._update_event.set() - async def next(self): + async def next(self) -> bool: await self._update_event.wait() self._update_event.clear() + return True diff --git a/pytrade/interfaces/data.py b/pytrade/interfaces/data.py index b4f9179..52b2b10 100644 --- a/pytrade/interfaces/data.py +++ b/pytrade/interfaces/data.py @@ -69,3 +69,7 @@ def universe(self) -> list[IInstrumentData]: @abstractmethod def get(self, instrument: Instrument, granularity: Granularity) -> IInstrumentData: raise NotImplementedError() + + @abstractmethod + async def next(self) -> bool: + raise NotImplementedError()