load_pair_history should not return None, but an empty dataframe if no

data is found
This commit is contained in:
Matthias
2019-12-04 06:57:44 +01:00
parent 78f8ba1226
commit 054484ad73
4 changed files with 7 additions and 7 deletions

View File

@@ -146,7 +146,7 @@ def load_pair_history(pair: str,
:param fill_up_missing: Fill missing values with "No action"-candles
:param drop_incomplete: Drop last candle assuming it may be incomplete.
:param startup_candles: Additional candles to load at the start of the period
:return: DataFrame with ohlcv data
:return: DataFrame with ohlcv data, or empty DataFrame
"""
timerange_startup = deepcopy(timerange)
@@ -174,7 +174,7 @@ def load_pair_history(pair: str,
f'No history data for pair: "{pair}", timeframe: {timeframe}. '
'Use `freqtrade download-data` to download the data'
)
return None
return DataFrame()
def load_data(datadir: Path,
@@ -216,7 +216,7 @@ def load_data(datadir: Path,
exchange=exchange,
fill_up_missing=fill_up_missing,
startup_candles=startup_candles)
if hist is not None:
if not hist.empty:
result[pair] = hist
if fail_without_data and not result: