From abcd70b9cfe917e8dc790043ff9a41f6a2dcefcb Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Sat, 16 Dec 2023 15:23:44 +0100 Subject: [PATCH] param: fix exponential memory allocation (#10178) * param: fix exponential memory allocation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- dvc/dependency/param.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dvc/dependency/param.py b/dvc/dependency/param.py index e30439018..538e8efb5 100644 --- a/dvc/dependency/param.py +++ b/dvc/dependency/param.py @@ -54,12 +54,14 @@ def read_param_file( continue return ret + from copy import deepcopy + from dpath import merge for key_path in key_paths: merge( ret, - dpath.search(config, key_path, separator="."), + deepcopy(dpath.search(config, key_path, separator=".")), separator=".", ) return ret