fix: add memo to deepcopy call to avoid recursion error (#4194)

Fix deepcopy bug by passing memo to deepcopy calls in custom component
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-10-17 22:53:23 -03:00 • committed by GitHub
commit 12476648f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -138,8 +138,8 @@ class Component(CustomComponent):
def __deepcopy__(self, memo):
if id(self) in memo:
return memo[id(self)]
kwargs = deepcopy(self.__config)
kwargs["inputs"] = deepcopy(self.__inputs)
kwargs = deepcopy(self.__config, memo)
kwargs["inputs"] = deepcopy(self.__inputs, memo)
new_component = type(self)(**kwargs)
new_component._code = self._code
new_component._outputs_map = self._outputs_map