From 46cd83ab4686849f8522ed358d30a4500ed7c420 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Fri, 14 Jun 2024 15:05:14 -0300 Subject: [PATCH] refactor: Improve handling of repr_value in CustomComponent --- .../base/langflow/custom/custom_component/custom_component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/base/langflow/custom/custom_component/custom_component.py b/src/backend/base/langflow/custom/custom_component/custom_component.py index 1e11a09ce..9eec57693 100644 --- a/src/backend/base/langflow/custom/custom_component/custom_component.py +++ b/src/backend/base/langflow/custom/custom_component/custom_component.py @@ -166,7 +166,7 @@ class CustomComponent(BaseComponent): self.repr_value = yaml.dump(self.repr_value) if isinstance(self.repr_value, BaseModel) and not isinstance(self.repr_value, Data): self.repr_value = str(self.repr_value) - elif hasattr(self.repr_value, "to_json"): + elif hasattr(self.repr_value, "to_json") and not isinstance(self.repr_value, Data): self.repr_value = self.repr_value.to_json() return self.repr_value