gravitino.dto.function.function_param_dto.FunctionParamDTO

class gravitino.dto.function.function_param_dto.FunctionParamDTO(_name: str, _data_type: Type, _comment: str | None = None, _default_value: FunctionArg | None = None)

Bases: FunctionParam, DataClassJsonMixin

DTO for function parameter.

__init__(_name: str, _data_type: Type, _comment: str | None = None, _default_value: FunctionArg | None = None) None

Methods

__init__(_name, _data_type[, _comment, ...])

comment()

Returns the optional parameter comment.

data_type()

Returns the parameter data type.

default_value()

Returns the default value of the parameter if provided, otherwise None.

from_dict(kvs, *[, infer_missing])

from_function_param(param)

Create a FunctionParamDTO from a FunctionParam instance.

from_json(s, *[, parse_float, parse_int, ...])

name()

Returns the parameter name.

schema(*[, infer_missing, only, exclude, ...])

to_dict([encode_json])

to_function_param()

Convert this DTO to a FunctionParam instance.

to_json(*[, skipkeys, ensure_ascii, ...])

Attributes

dataclass_json_config

comment() str | None

Returns the optional parameter comment.

data_type() Type

Returns the parameter data type.

default_value() Expression | None

Returns the default value of the parameter if provided, otherwise None.

classmethod from_function_param(param: FunctionParam) FunctionParamDTO

Create a FunctionParamDTO from a FunctionParam instance.

name() str

Returns the parameter name.

to_function_param() FunctionParam

Convert this DTO to a FunctionParam instance.