From e2cd23b1d2318bc5874e9fd8e78c3ca9add62f47 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 10 Apr 2023 16:33:56 +0200 Subject: [PATCH] Remove deprecated pandas option --- freqtrade/data/btanalysis.py | 10 ++-------- freqtrade/data/converter.py | 2 +- freqtrade/data/history/featherdatahandler.py | 5 +---- freqtrade/data/history/jsondatahandler.py | 5 +---- freqtrade/data/history/parquetdatahandler.py | 5 +---- 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/freqtrade/data/btanalysis.py b/freqtrade/data/btanalysis.py index 3567f4112..c5905acde 100644 --- a/freqtrade/data/btanalysis.py +++ b/freqtrade/data/btanalysis.py @@ -246,14 +246,8 @@ def _load_backtest_data_df_compatibility(df: pd.DataFrame) -> pd.DataFrame: """ Compatibility support for older backtest data. """ - df['open_date'] = pd.to_datetime(df['open_date'], - utc=True, - infer_datetime_format=True - ) - df['close_date'] = pd.to_datetime(df['close_date'], - utc=True, - infer_datetime_format=True - ) + df['open_date'] = pd.to_datetime(df['open_date'], utc=True) + df['close_date'] = pd.to_datetime(df['close_date'], utc=True) # Compatibility support for pre short Columns if 'is_short' not in df.columns: df['is_short'] = False diff --git a/freqtrade/data/converter.py b/freqtrade/data/converter.py index 7ce98de42..2d3855d87 100644 --- a/freqtrade/data/converter.py +++ b/freqtrade/data/converter.py @@ -34,7 +34,7 @@ def ohlcv_to_dataframe(ohlcv: list, timeframe: str, pair: str, *, cols = DEFAULT_DATAFRAME_COLUMNS df = DataFrame(ohlcv, columns=cols) - df['date'] = to_datetime(df['date'], unit='ms', utc=True, infer_datetime_format=True) + df['date'] = to_datetime(df['date'], unit='ms', utc=True) # Some exchanges return int values for Volume and even for OHLC. # Convert them since TA-LIB indicators used in the strategy assume floats diff --git a/freqtrade/data/history/featherdatahandler.py b/freqtrade/data/history/featherdatahandler.py index bb387fc84..28a12fb29 100644 --- a/freqtrade/data/history/featherdatahandler.py +++ b/freqtrade/data/history/featherdatahandler.py @@ -63,10 +63,7 @@ class FeatherDataHandler(IDataHandler): pairdata.columns = self._columns pairdata = pairdata.astype(dtype={'open': 'float', 'high': 'float', 'low': 'float', 'close': 'float', 'volume': 'float'}) - pairdata['date'] = to_datetime(pairdata['date'], - unit='ms', - utc=True, - infer_datetime_format=True) + pairdata['date'] = to_datetime(pairdata['date'], unit='ms', utc=True) return pairdata def ohlcv_append( diff --git a/freqtrade/data/history/jsondatahandler.py b/freqtrade/data/history/jsondatahandler.py index f016c0ec1..ed7a33f8e 100644 --- a/freqtrade/data/history/jsondatahandler.py +++ b/freqtrade/data/history/jsondatahandler.py @@ -75,10 +75,7 @@ class JsonDataHandler(IDataHandler): return DataFrame(columns=self._columns) pairdata = pairdata.astype(dtype={'open': 'float', 'high': 'float', 'low': 'float', 'close': 'float', 'volume': 'float'}) - pairdata['date'] = to_datetime(pairdata['date'], - unit='ms', - utc=True, - infer_datetime_format=True) + pairdata['date'] = to_datetime(pairdata['date'], unit='ms', utc=True) return pairdata def ohlcv_append( diff --git a/freqtrade/data/history/parquetdatahandler.py b/freqtrade/data/history/parquetdatahandler.py index 57581861d..e6b2481d2 100644 --- a/freqtrade/data/history/parquetdatahandler.py +++ b/freqtrade/data/history/parquetdatahandler.py @@ -62,10 +62,7 @@ class ParquetDataHandler(IDataHandler): pairdata.columns = self._columns pairdata = pairdata.astype(dtype={'open': 'float', 'high': 'float', 'low': 'float', 'close': 'float', 'volume': 'float'}) - pairdata['date'] = to_datetime(pairdata['date'], - unit='ms', - utc=True, - infer_datetime_format=True) + pairdata['date'] = to_datetime(pairdata['date'], unit='ms', utc=True) return pairdata def ohlcv_append(