From d07a73cf7034280e620e7780a435ed743f9e97ba Mon Sep 17 00:00:00 2001 From: jaredgoldman Date: Wed, 19 Apr 2023 14:47:19 -0400 Subject: [PATCH] Add type annotation for open_ping_task' --- piker/brokers/kucoin.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/piker/brokers/kucoin.py b/piker/brokers/kucoin.py index d1c3c1c7..d997e8f6 100755 --- a/piker/brokers/kucoin.py +++ b/piker/brokers/kucoin.py @@ -462,7 +462,10 @@ async def open_symbol_search( @acm -async def open_ping_task(ws: wsproto.WSConnection, ping_interval, connect_id): +async def open_ping_task( + ws: wsproto.WSConnection, + ping_interval, connect_id +) -> AsyncGenerator[None, None]: ''' Spawn a non-blocking task that pings the ws server every ping_interval so Kucoin doesn't drop @@ -678,7 +681,9 @@ async def open_history_client( end_dt: datetime | None = None, start_dt: datetime | None = None, ) -> tuple[ - np.ndarray, datetime | None, datetime | None + np.ndarray, datetime | + None, datetime | + None ]: # start # end if timeframe != 60: raise DataUnavailable('Only 1m bars are supported') @@ -699,9 +704,6 @@ async def open_history_client( f'{inow - times[-1]}' ) - if (inow - times[-1]) > 60: - await tractor.breakpoint() - start_dt = pendulum.from_timestamp(times[0]) end_dt = pendulum.from_timestamp(times[-1])