Fix typehints

This commit is contained in:
Matthias 2020-12-15 20:59:58 +01:00
parent 011ba1d9ae
commit d1fda28d2e
3 changed files with 7 additions and 5 deletions

View File

@ -735,7 +735,7 @@ class Exchange:
def refresh_latest_ohlcv(self, pair_list: ListPairsWithTimeframes, *,
since_ms: Optional[int] = None, cache: bool = True
) -> Dict[str, DataFrame]:
) -> Dict[Tuple[str, str], DataFrame]:
"""
Refresh in-memory OHLCV asynchronously and set `_klines` with the result
Loops asynchronously over pair_list and downloads all pairs async (semi-parallel).

View File

@ -1,12 +1,13 @@
"""
Rate of change pairlist filter
"""
from copy import deepcopy
import logging
from typing import Any, Dict, List
from copy import deepcopy
from typing import Any, Dict, List, Optional
import arrow
from cachetools.ttl import TTLCache
from pandas import DataFrame
from freqtrade.exceptions import OperationalException
from freqtrade.misc import plural
@ -78,7 +79,7 @@ class RangeStabilityFilter(IPairList):
pairlist.remove(p)
return pairlist
def _validate_pair_loc(self, pair: str, daily_candles: Dict[str, Any]) -> bool:
def _validate_pair_loc(self, pair: str, daily_candles: Optional[DataFrame]) -> bool:
"""
Validate trading range
:param pair: Pair that's currently validated

View File

@ -140,7 +140,8 @@ def test_assert_df(default_conf, mocker, ohlcv_history, caplog):
with pytest.raises(StrategyError,
match=r"Dataframe returned from strategy.*last close price\."):
_STRATEGY.assert_df(ohlcv_history, len(ohlcv_history),
ohlcv_history.loc[df_len, 'close'] + 0.01, ohlcv_history.loc[df_len, 'date'])
ohlcv_history.loc[df_len, 'close'] + 0.01,
ohlcv_history.loc[df_len, 'date'])
with pytest.raises(StrategyError,
match=r"Dataframe returned from strategy.*last date\."):
_STRATEGY.assert_df(ohlcv_history, len(ohlcv_history),