refactor: Update build_custom_component_template return type

Update the return type of the build_custom_component_template function in utils.py to include the possibility of returning a Component object. This change ensures that the function can handle both CustomComponent and Component objects, improving flexibility and compatibility.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-22 18:00:46 -03:00
commit 69b756c35b

View file

@ -385,7 +385,7 @@ def build_custom_component_template_from_inputs(
def build_custom_component_template(
custom_component: CustomComponent,
user_id: Optional[Union[str, UUID]] = None,
) -> Tuple[Dict[str, Any], CustomComponent]:
) -> Tuple[Dict[str, Any], CustomComponent | Component]:
"""Build a custom component template"""
try:
if "inputs" in custom_component.template_config: