snowflake.core.function.FunctionResourceΒΆ
- class snowflake.core.function.FunctionResource(name_with_args: Annotated[str, Strict(strict=True)], collection: FunctionCollection)ΒΆ
Bases:
SchemaObjectReferenceMixin
[FunctionCollection
]Represents a reference to a Snowflake function.
With this function reference, you can create and fetch information about functions, as well as perform certain actions on them.
Attributes
- databaseΒΆ
- fully_qualified_nameΒΆ
- rootΒΆ
Methods
- delete(if_exists: bool = False) None ΒΆ
Delete this function.
- Parameters:
if_exists (bool, optional) β Whether to error if the function doesnβt exist. Default is
False
.
Examples
Deleting a function using its reference, erroring if it doesnβt exist:
>>> function_reference.delete()
Deleting a function using its reference, if it exists:
>>> function_reference.delete(if_exists=True) The `delete` method is deprecated; use `drop` instead.
- drop(if_exists: bool = False) None ΒΆ
Drop this function.
- Parameters:
if_exists (bool, optional) β Whether to error if the function doesnβt exist. Default is
False
.
Examples
Dropping a function using its reference, erroring if it doesnβt exist:
>>> function_reference.drop()
Dropping a function using its reference, if it exists:
>>> function_reference.drop(if_exists=True)
- execute(input_args: List[Any] | None = None) Any ΒΆ
Execute this function.
- Parameters:
input_args (List[Any], optional) β A list of arguments to pass to the function. The number of arguments must match the number of arguments the function expects.
Examples
Executing a function using its reference:
>>> function_reference.execute(input_args=[1, 2, "word"])