refactor: Remove unused code in update_template_field function

This commit is contained in:
ogabrielluiz 2024-06-12 16:16:09 -03:00
commit 58edd9694b

View file

@ -252,14 +252,13 @@ def get_field_dict(field: Union[Input, dict]):
def run_build_inputs(
frontend_node: ComponentFrontendNode,
custom_component: Component,
user_id: Optional[Union[str, UUID]] = None,
):
"""Run the build inputs of a custom component."""
try:
field_config = custom_component.build_inputs(user_id=user_id)
add_extra_fields(frontend_node, field_config, field_config.values())
# add_extra_fields(frontend_node, field_config, field_config.values())
return field_config
except Exception as exc:
logger.error(f"Error running build inputs: {exc}")
@ -365,11 +364,6 @@ def build_custom_component_template_from_inputs(
# The List of Inputs fills the role of the build_config and the entrypoint_args
field_config = custom_component.template_config
frontend_node = ComponentFrontendNode.from_inputs(**field_config)
field_config = run_build_inputs(
frontend_node=frontend_node,
custom_component=custom_component,
user_id=user_id,
)
frontend_node = add_code_field(frontend_node, custom_component.code, field_config.get("code", {}))
# But we now need to calculate the return_type of the methods in the outputs
for output in frontend_node.outputs: