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_temporary (bool, optional) – Specifies whether the UDF is temporary or not

  • is_aggregate (bool, optional) – Specifies whether the UDF is an aggregate function. Applicable only for Python language type

  • is_memoizable (bool, optional) – Indicates whether the function is memoizable. Applicable only for Python language type.

  • is_table_function (bool, optional) – True if the UDF is a table function; false otherwise.

  • valid_for_clustering (bool, optional) – True if the UDF is valid for clustering; false otherwise.

  • is_secure (bool, optional) – Specifies whether the function/procedure is secure or not

  • comment (str, optional) – Specifies a comment for the function/procedure

  • body (str, optional) – Function/procedure definition

  • created_on (datetime, optional) – The date and time when the function/procedure was created

  • schema_name (str, optional) – The name of the schema in which the function/procedure exists.

  • database_name (str, optional) – The name of the database in which the function/procedure exists.

  • min_num_arguments (int, optional) – The minimum number of arguments

  • max_num_arguments (int, optional) – The maximum number of arguments

  • owner (str, optional) – Role that owns the function/procedure

  • owner_role_type (str, optional) – The type of role that owns the function/procedure

  • is_builtin (bool, 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.