refactor: Improve handling of repr_value in CustomComponent
This commit is contained in:
parent
05c2a59928
commit
46cd83ab46
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue