From 5750d05891ae7c30c310b58399ff10b5d95e7ea8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 24 Dec 2024 15:19:22 +0100 Subject: [PATCH] feat: deprecate hdf5 as data storage --- docs/data-download.md | 2 +- docs/deprecated.md | 8 +++++++- freqtrade/data/history/datahandlers/idatahandler.py | 7 +++++++ tests/data/test_datahandler.py | 5 +++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/data-download.md b/docs/data-download.md index 559211c2f..8b21dc19b 100644 --- a/docs/data-download.md +++ b/docs/data-download.md @@ -162,7 +162,7 @@ Freqtrade currently supports the following data-formats: * `feather` - a dataformat based on Apache Arrow * `json` - plain "text" json files * `jsongz` - a gzip-zipped version of json files -* `hdf5` - a high performance datastore +* `hdf5` - a high performance datastore (deprecated) * `parquet` - columnar datastore (OHLCV only) By default, both OHLCV data and trades data are stored in the `feather` format. diff --git a/docs/deprecated.md b/docs/deprecated.md index 5357acc62..744460407 100644 --- a/docs/deprecated.md +++ b/docs/deprecated.md @@ -81,4 +81,10 @@ version 2023.3 saw the removal of `populate_any_indicators` in favor of split me ## Removal of `protections` from configuration - Setting protections from the configuration via `"protections": [],` has been removed in 2024.10, after having raised deprecation warnings for over 3 years. +Setting protections from the configuration via `"protections": [],` has been removed in 2024.10, after having raised deprecation warnings for over 3 years. + +## hdf5 data storage + +Using hdf5 as data storage has been deprecated in 2024.12 and will be removed in 2025.1. We recommend switching to the feather data format. + +Please use the [`convert-data` subcommand](data-download.md#sub-command-convert-data) to convert your existing data to one of the supported formats. diff --git a/freqtrade/data/history/datahandlers/idatahandler.py b/freqtrade/data/history/datahandlers/idatahandler.py index 330620134..3331b084e 100644 --- a/freqtrade/data/history/datahandlers/idatahandler.py +++ b/freqtrade/data/history/datahandlers/idatahandler.py @@ -551,6 +551,13 @@ def get_datahandlerclass(datatype: str) -> type[IDataHandler]: elif datatype == "hdf5": from .hdf5datahandler import HDF5DataHandler + logger.warning( + "DEPRECATED: The hdf5 dataformat is deprecated and will be removed in a the " + "next release. " + "Please use the convert-data command to convert your data to a supported format." + "We recommend using the feather format, as it is faster and is more space-efficient." + ) + return HDF5DataHandler elif datatype == "feather": from .featherdatahandler import FeatherDataHandler diff --git a/tests/data/test_datahandler.py b/tests/data/test_datahandler.py index e9ffcc7a1..74936b890 100644 --- a/tests/data/test_datahandler.py +++ b/tests/data/test_datahandler.py @@ -360,6 +360,11 @@ def test_hdf5datahandler_trades_load(testdatadir): # assert len([t for t in trades2 if t[0] > timerange.stopts * 1000]) == 0 +def test_hdf5datahandler_deprecated(testdatadir, caplog): + get_datahandler(testdatadir, "hdf5") + log_has_re(r"DEPRECATED: The hdf5 dataformat is deprecated.*", caplog) + + @pytest.mark.parametrize( "pair,timeframe,candle_type,candle_append,startdt,enddt", [