PythonUDF
A Python user-defined function (UDF) in Snowflake allows users to define their own custom functions in Python. These functions can be used to perform operations that are not available as standard SQL functions.
Examples
Python
YAML
Fields
name
(string, required) - The name of the function.returns
(string, required) - The data type of the function's return value.runtime_version
(string, required) - The version of the Python runtime to use.handler
(string, required) - The name of the method to call in the Python script.args
(list, required) - A list of arguments that the function takes.as_
(string) - The Python code to execute when the function is called.comment
(string) - A comment for the function.copy_grants
(bool) - Whether to copy grants from the existing function. Defaults to False.external_access_integrations
(list) - List of external integrations accessible by the function.imports
(list) - List of modules to import in the function.null_handling
(NullHandling) - Specifies how NULL values are handled by the function.owner
(string or Role) - The owner role of the function. Defaults to "SYSADMIN".packages
(list) - List of Python packages that the function can use.secrets
(dict) - Secrets that can be accessed by the function.secure
(bool) - Whether the function is secure. Defaults to False.volatility
(string or Volatility) - The volatility of the function.
Last updated