feat: Initialize component inputs with default values
The code changes in `component.py` initialize component inputs with default values if they are not provided. This ensures that the inputs are always set, even if they are not explicitly passed. Additionally, the commit message follows the established convention of using a prefix to indicate the type of change.
This commit is contained in:
parent
dde81e1954
commit
c51e311aa5
1 changed files with 5 additions and 0 deletions
|
|
@ -80,6 +80,11 @@ class Component(CustomComponent):
|
|||
if key in self.__dict__:
|
||||
raise ValueError(f"Key {key} already exists in {self.__class__.__name__}")
|
||||
setattr(self, key, value)
|
||||
for key, input_obj in self._inputs.items():
|
||||
if not hasattr(self, key):
|
||||
setattr(self, key, input_obj.value or None)
|
||||
if key not in params:
|
||||
params[key] = input_obj.value or None
|
||||
self._arguments = params
|
||||
|
||||
def _set_outputs(self, outputs: List[dict]):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue