Fix return value for power components in Vertex class

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-01-26 09:56:36 -03:00
commit 537747951a

View file

@ -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 {}