From c0929c042a0f3e14422fa67dff077a8c3413ab20 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 29 Jun 2023 14:03:57 -0400 Subject: [PATCH] ib: fix `Client.trades()` return type annot --- piker/brokers/ib/api.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/piker/brokers/ib/api.py b/piker/brokers/ib/api.py index fd0d024d..880e9f53 100644 --- a/piker/brokers/ib/api.py +++ b/piker/brokers/ib/api.py @@ -24,7 +24,10 @@ from contextlib import ( contextmanager as cm, ) from contextlib import AsyncExitStack -from dataclasses import asdict, astuple +from dataclasses import ( + asdict, + astuple, +) from datetime import datetime from functools import ( partial, @@ -402,13 +405,13 @@ class Client: # NOTE: the ib.client here is "throttled" to 45 rps by default - async def trades(self) -> dict[str, Any]: + async def trades(self) -> list[dict]: ''' Return list of trade-fills from current session in ``dict``. ''' - fills: list[Fill] = self.ib.fills() norm_fills: list[dict] = [] + fills: list[Fill] = self.ib.fills() for fill in fills: fill = fill._asdict() # namedtuple for key, val in fill.items():