snowflake.core.user_defined_function.UserDefinedFunction

class snowflake.core.user_defined_function.UserDefinedFunction(*, name: Annotated[str, Strict(strict=True)], is_temporary: Annotated[bool, Strict(strict=True)] | None = None, is_aggregate: Annotated[bool, Strict(strict=True)] | None = None, is_memoizable: Annotated[bool, Strict(strict=True)] | None = None, is_table_function: Annotated[bool, Strict(strict=True)] | None = None, valid_for_clustering: Annotated[bool, Strict(strict=True)] | None = None, is_secure: Annotated[bool, Strict(strict=True)] | None = None, arguments: List[Argument], return_type: ReturnType, language_config: FunctionLanguage, comment: Annotated[str, Strict(strict=True)] | None = None, body: Annotated[str, Strict(strict=True)] | None = None, created_on: datetime | None = None, schema_name: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)])] | None = None, database_name: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)])] | None = None, min_num_arguments: Annotated[int, Strict(strict=True)] | None = None, max_num_arguments: Annotated[int, Strict(strict=True)] | None = None, owner: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)])] | None = None, owner_role_type: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)])] | None = None, is_builtin: Annotated[bool, Strict(strict=True)] | None = None)

Bases: BaseModel

A model object representing the UserDefinedFunction resource.

Constructs an object of type UserDefinedFunction with the provided properties.

Parameters:
  • name (str) – The name of the UDF

  • arguments (list[Argument]) – List of arguments for the function/procedure

  • return_type (ReturnType)

language_config : FunctionLanguage

is_temporarybool, optional

Specifies whether the UDF is temporary or not

is_aggregatebool, optional

Specifies whether the UDF is an aggregate function. Applicable only for Python language type

is_memoizablebool, optional

Indicates whether the function is memoizable. Applicable only for Python language type.

is_table_functionbool, optional

True if the UDF is a table function; false otherwise.

valid_for_clusteringbool, optional

True if the UDF is valid for clustering; false otherwise.

is_securebool, optional

Specifies whether the function/procedure is secure or not

commentstr, optional

Specifies a comment for the function/procedure

bodystr, optional

Function/procedure definition

created_ondatetime, optional

The date and time when the function/procedure was created

schema_namestr, optional

The name of the schema in which the function/procedure exists.

database_namestr, optional

The name of the database in which the function/procedure exists.

min_num_argumentsint, optional

The minimum number of arguments

max_num_argumentsint, optional

The maximum number of arguments

ownerstr, optional

Role that owns the function/procedure

owner_role_typestr, optional

The type of role that owns the function/procedure

is_builtinbool, optional

If the function/procedure is built-in or not (user-defined)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Methods

classmethod from_dict(obj: dict) UserDefinedFunction

Create an instance of UserDefinedFunction from a dict.

classmethod from_json(json_str: str) UserDefinedFunction

Create an instance of UserDefinedFunction from a JSON string

to_dict(hide_readonly_properties: bool = False) dict[str, Any]

Returns the dictionary representation of the model using alias

to_dict_without_readonly_properties() dict[str, Any]

Return the dictionary representation of the model without readonly properties.

to_json() str

Returns the JSON representation of the model using alias.

to_str() str

Returns the string representation of the model using alias.

Language: English