🐛 fix(loading.py): make a copy of the params before modifying it to prevent unintended side effects
This commit is contained in:
parent
7b22fd2711
commit
261e258ed4
1 changed files with 5 additions and 2 deletions
|
|
@ -116,9 +116,12 @@ def instantiate_based_on_type(class_object, base_type, node_type, params):
|
||||||
|
|
||||||
|
|
||||||
def instantiate_custom_component(node_type, class_object, params):
|
def instantiate_custom_component(node_type, class_object, params):
|
||||||
class_object = get_function_custom(params.pop("code"))
|
# we need to make a copy of the params because we will be
|
||||||
|
# modifying it
|
||||||
|
params_copy = params.copy()
|
||||||
|
class_object = get_function_custom(params_copy.pop("code"))
|
||||||
custom_component = class_object()
|
custom_component = class_object()
|
||||||
built_object = custom_component.build(**params)
|
built_object = custom_component.build(**params_copy)
|
||||||
return built_object, {"repr": custom_component.custom_repr()}
|
return built_object, {"repr": custom_component.custom_repr()}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue