refactor: Remove unused code in update_template_field function
This commit is contained in:
parent
3ac8bf99eb
commit
58edd9694b
1 changed files with 1 additions and 7 deletions
|
|
@ -252,14 +252,13 @@ def get_field_dict(field: Union[Input, dict]):
|
||||||
|
|
||||||
|
|
||||||
def run_build_inputs(
|
def run_build_inputs(
|
||||||
frontend_node: ComponentFrontendNode,
|
|
||||||
custom_component: Component,
|
custom_component: Component,
|
||||||
user_id: Optional[Union[str, UUID]] = None,
|
user_id: Optional[Union[str, UUID]] = None,
|
||||||
):
|
):
|
||||||
"""Run the build inputs of a custom component."""
|
"""Run the build inputs of a custom component."""
|
||||||
try:
|
try:
|
||||||
field_config = custom_component.build_inputs(user_id=user_id)
|
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
|
return field_config
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.error(f"Error running build inputs: {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
|
# The List of Inputs fills the role of the build_config and the entrypoint_args
|
||||||
field_config = custom_component.template_config
|
field_config = custom_component.template_config
|
||||||
frontend_node = ComponentFrontendNode.from_inputs(**field_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", {}))
|
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
|
# But we now need to calculate the return_type of the methods in the outputs
|
||||||
for output in frontend_node.outputs:
|
for output in frontend_node.outputs:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue