From cb36da3dedfa8c7843228ed22219f7679c388e09 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Mon, 6 Jun 2022 13:12:02 +0300 Subject: [PATCH] Fix pre-existing pipeline raises an exception --- clearml/automation/controller.py | 12 +++++++++--- clearml/utilities/proxy_object.py | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/clearml/automation/controller.py b/clearml/automation/controller.py index 500e803b..d9cf0c71 100644 --- a/clearml/automation/controller.py +++ b/clearml/automation/controller.py @@ -2955,9 +2955,15 @@ class PipelineDecorator(PipelineController): kwargs[inspect_func.args[i]] = v kwargs_artifacts.update( - {k: walk_nested_dict_tuple_list( - v, lambda x: x._remoteref() if isinstance(x, LazyEvalWrapper) else x) - for k, v in kwargs.items() if isinstance(v, LazyEvalWrapper)} + { + k: walk_nested_dict_tuple_list( + v, + lambda x: x._remoteref() if isinstance(x, LazyEvalWrapper) else x, + stop_condition=lambda x: isinstance(x, LazyEvalWrapper) and x._remoteref(), + ) + for k, v in kwargs.items() + if isinstance(v, LazyEvalWrapper) + } ) kwargs = {k: deepcopy(v) for k, v in kwargs.items() if not isinstance(v, LazyEvalWrapper)} diff --git a/clearml/utilities/proxy_object.py b/clearml/utilities/proxy_object.py index 73801cf8..97161c7d 100644 --- a/clearml/utilities/proxy_object.py +++ b/clearml/utilities/proxy_object.py @@ -221,9 +221,9 @@ def naive_nested_from_flat_dictionary(flat_dict, sep='/'): } -def walk_nested_dict_tuple_list(dict_list_tuple, callback): +def walk_nested_dict_tuple_list(dict_list_tuple, callback, stop_condition=None): nested = (dict, tuple, list) - if not isinstance(dict_list_tuple, nested): + if not isinstance(dict_list_tuple, nested) or (stop_condition and stop_condition(dict_list_tuple)): return callback(dict_list_tuple) if isinstance(dict_list_tuple, dict):