Skip to content

featurebyte.FunctionParameter

class FunctionParameter(
name: str,
dtype: Union[DBVarType, str],
default_value: Union[StrictInt, StrictFloat, StrictStr, bool, NoneType]=None,
test_value: Union[StrictInt, StrictFloat, StrictStr, bool, NoneType]=None
)

Description

FunctionParameter is used to define the input parameters of a UserDefinedFunction.

Parameters

  • name: str
    Name of the function input parameter (required)

  • dtype: Union[DBVarType, str]
    Data type of the function input parameter (required)

  • default_value: Union[StrictInt, StrictFloat, StrictStr, bool, NoneType]
    Default value of the function input parameter (optional). Default value is used to make the function input parameter optional.

  • test_value: Union[StrictInt, StrictFloat, StrictStr, bool, NoneType]
    Test value of the function input parameter (optional). Test value is used to check the execution of the function during the creation & update of the UserDefinedFunction.

Examples

Create a float function parameter:

>>> fb.FunctionParameter(name="param1", dtype=fb.enum.DBVarType.FLOAT)
FunctionParameter(name='param1', dtype='FLOAT', default_value=None, test_value=None)
Create an integer function parameter with default value 1:

>>> fb.FunctionParameter(name="param1", dtype=fb.enum.DBVarType.INT, default_value=1)
FunctionParameter(name='param1', dtype='INT', default_value=1, test_value=None)