fix: Improve error message for download-data edgecase
hyperliquid doesn't provide historic data, neither klines nor trades. This made the error message missleading. closes #11270
This commit is contained in:
@@ -679,11 +679,17 @@ def download_data(
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if not exchange.get_option("ohlcv_has_history", True):
|
if not exchange.get_option("ohlcv_has_history", True):
|
||||||
raise OperationalException(
|
if not exchange.get_option("trades_has_history", True):
|
||||||
f"Historic klines not available for {exchange.name}. "
|
raise OperationalException(
|
||||||
"Please use `--dl-trades` instead for this exchange "
|
f"Historic data not available for {exchange.name}. "
|
||||||
"(will unfortunately take a long time)."
|
f"{exchange.name} does not support downloading trades or ohlcv data."
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
raise OperationalException(
|
||||||
|
f"Historic klines not available for {exchange.name}. "
|
||||||
|
"Please use `--dl-trades` instead for this exchange "
|
||||||
|
"(will unfortunately take a long time)."
|
||||||
|
)
|
||||||
migrate_data(config, exchange)
|
migrate_data(config, exchange)
|
||||||
pairs_not_available = refresh_backtest_ohlcv_data(
|
pairs_not_available = refresh_backtest_ohlcv_data(
|
||||||
exchange,
|
exchange,
|
||||||
|
|||||||
@@ -102,3 +102,16 @@ def test_download_data_main_data_invalid(mocker):
|
|||||||
)
|
)
|
||||||
with pytest.raises(OperationalException, match=r"Historic klines not available for .*"):
|
with pytest.raises(OperationalException, match=r"Historic klines not available for .*"):
|
||||||
download_data_main(config)
|
download_data_main(config)
|
||||||
|
|
||||||
|
patch_exchange(mocker, exchange="hyperliquid")
|
||||||
|
mocker.patch(f"{EXMS}.get_markets", return_value={"ETH/USDC": {}})
|
||||||
|
config2 = setup_utils_configuration({"exchange": "hyperliquid"}, RunMode.UTIL_EXCHANGE)
|
||||||
|
config2.update(
|
||||||
|
{
|
||||||
|
"days": 20,
|
||||||
|
"pairs": ["ETH/USDC", "XRP/USDC"],
|
||||||
|
"timeframes": ["5m", "1h"],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
with pytest.raises(OperationalException, match=r"Historic data not available for .*"):
|
||||||
|
download_data_main(config2)
|
||||||
|
|||||||
Reference in New Issue
Block a user