From 717f17a9b5bde812e4bb0adac117357be2b5d7b6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 2 Mar 2025 19:56:59 +0100 Subject: [PATCH] chore: fix mutable defaults bug --- freqtrade/freqai/data_kitchen.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index a10f1cb9b..6cb52eb29 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -773,8 +773,8 @@ class FreqaiDataKitchen: def use_strategy_to_populate_indicators( # noqa: C901 self, strategy: IStrategy, - corr_dataframes: dict = {}, - base_dataframes: dict = {}, + corr_dataframes: dict[str, DataFrame] | None = None, + base_dataframes: dict[str, dict[str, DataFrame]] | None = None, pair: str = "", prediction_dataframe: DataFrame | None = None, do_corr_pairs: bool = True, @@ -793,6 +793,10 @@ class FreqaiDataKitchen: :return: dataframe: DataFrame = dataframe containing populated indicators """ + if not corr_dataframes: + corr_dataframes = {} + if not base_dataframes: + base_dataframes = {} # check if the user is using the deprecated populate_any_indicators function new_version = inspect.getsource(strategy.populate_any_indicators) == (