snowflake.snowpark.udf.UserDefinedFunction

class snowflake.snowpark.udf.UserDefinedFunction(func: Union[Callable, Tuple[str, str]], return_type: DataType, input_types: List[DataType], name: str, is_return_nullable: bool = False, packages: Optional[List[Union[str, module]]] = None)[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/udf.py#L53-L124)

Bases: object

Encapsulates a user defined lambda or function that is returned by udf(), UDFRegistration.register() or UDFRegistration.register_from_file(). The constructor of this class is not supposed to be called directly.

Call an instance of UserDefinedFunction to generate Column expressions. The input type can be a column name as a str, or a Column object.

Attributes

func

The Python function or a tuple containing the Python file path and the function name.

name

The UDF name.

语言: 中文