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>
This commit is contained in:
Helio Machado
2023-12-16 20:08:44 +05:45
committed by GitHub
co-authored by pre-commit-ci[bot]
parent 3e4e143bee
commit abcd70b9cf
+3 -1
View File
@@ -54,12 +54,14 @@ def read_param_file(
continue continue
return ret return ret
from copy import deepcopy
from dpath import merge from dpath import merge
for key_path in key_paths: for key_path in key_paths:
merge( merge(
ret, ret,
dpath.search(config, key_path, separator="."), deepcopy(dpath.search(config, key_path, separator=".")),
separator=".", separator=".",
) )
return ret return ret