You are viewing documentation about an older version (1.15.0). View latest version

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]

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.