Fix some type errors

This commit is contained in:
Matthias
2023-03-15 21:09:25 +01:00
parent b469addffb
commit d45599ca3b
3 changed files with 16 additions and 17 deletions

View File

@@ -159,7 +159,7 @@ class RPC:
"""
# Fetch open trades
if trade_ids:
trades: List[Trade] = Trade.get_trades(trade_filter=Trade.id.in_(trade_ids)).all()
trades: Sequence[Trade] = Trade.get_trades(trade_filter=Trade.id.in_(trade_ids)).all()
else:
trades = Trade.get_open_trades()
@@ -449,7 +449,7 @@ class RPC:
""" Returns cumulative profit statistics """
trade_filter = ((Trade.is_open.is_(False) & (Trade.close_date >= start_date)) |
Trade.is_open.is_(True))
trades: Sequence[Trade] = Trade._session.execute(Trade.get_trades_query(
trades: Sequence[Trade] = Trade._session.scalars(Trade.get_trades_query(
trade_filter, include_orders=False).order_by(Trade.id)).all()
profit_all_coin = []