snowflake.core.function.FunctionResource¶

class snowflake.core.function.FunctionResource(name_with_args: Annotated[str, Strict(strict=True)], collection_class: FunctionCollection)¶

Bases: FunctionResourceBase

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¶

The DatabaseResource this reference belongs to.

fully_qualified_name¶

Return the fully qualified name of the object this reference points to.

root¶

The Root object this reference belongs to.

Methods

delete(if_exists: bool = False) → None¶

The delete() method is deprecated; use drop() instead.

drop(if_exists: bool | None = None) → None¶

Delete a function.

Parameters:

if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.

drop_async(if_exists: bool | None = None) → PollingOperation[None]¶

An asynchronous version of drop().

Refer to PollingOperation for more information on asynchronous execution and the return type.

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"])
Copy
execute_async(input_args: list[Any] | None = None) → PollingOperation[Any]¶

An asynchronous version of execute().

Refer to PollingOperation for more information on asynchronous execution and the return type.

fetch() → Function¶

Fetch a Function.

fetch_async() → PollingOperation[Function]¶

An asynchronous version of fetch().

Refer to PollingOperation for more information on asynchronous execution and the return type.