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

2
uv.lock generated
View file

@ -3632,7 +3632,7 @@ dev = [
[package.metadata]
requires-dist = [
{ name = "assemblyai", specifier = ">=0.33.0" },
{ name = "astra-assistants", specifier = ">=2.2.2" },
{ name = "astra-assistants", specifier = "~=2.2.2" },
{ name = "beautifulsoup4", specifier = ">=4.12.2" },
{ name = "boto3", specifier = "~=1.34.162" },
{ name = "cassio", marker = "extra == 'cassio'", specifier = ">=0.1.7" },