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() β†’ NoneΒΆ

The delete method is deprecated; use drop instead.

drop() β†’ NoneΒΆ

Drop this function.

Examples

Deleting a function using its reference:

>>> function_reference.drop()
Copy
execute(input_args: List[Any] = None) β†’ objectΒΆ

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"])
Copy
fetch() β†’ FunctionΒΆ

Fetch the details of a function.

Examples

Fetching a reference to a function to print its name:

>>> function_reference = root.databases["my_db"].schemas["my_schema"].functions["foo(REAL)"]
>>> my_function = function_reference.fetch()
>>> print(my_function.name)
Copy