Fix return value for power components in Vertex class
This commit is contained in:
parent
8d55bd2505
commit
537747951a
1 changed files with 7 additions and 0 deletions
|
|
@ -80,6 +80,13 @@ class Vertex:
|
|||
# If the Vertex.type is a power component
|
||||
# then we need to return the built object
|
||||
# instead of the result dict
|
||||
if self.is_power_component and not isinstance(self._built_object, UnbuiltObject):
|
||||
result = self._built_object
|
||||
# if it is not a dict or a string and hasattr model_dump then
|
||||
# return the model_dump
|
||||
if not isinstance(result, (dict, str)) and hasattr(result, "content"):
|
||||
return result.content
|
||||
return result
|
||||
|
||||
if isinstance(self._built_result, UnbuiltResult):
|
||||
return {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue