snowflake.core.task.StoredProcedureCall¶
- class snowflake.core.task.StoredProcedureCall(func: Callable[[...], Any] | StoredProcedure, *, args: List[Any] | None = None, return_type: DataType | None = None, input_types: List[DataType] | None = None, stage_location: str | None = None, imports: List[str | Tuple[str, str]] | None = None, packages: List[str | ModuleType] | None = None)¶
Bases:
object
Represents a procedure call used as a task’s
definition
.- Parameters:
func –
When it’s a
Callable
, typically a function, an anonymous stored procedure will be created as the Task’s definition by using thisCallable
. Note that the first parameter of your function should be a snowpark Session.When it’s a
StoredProcedure
, it will be converted to a SQL to call an existing stored procedure. TheStoredProcedure
must be a permanent one instead of a temporary one because a Task will run in a different session than the session that creates the Task. A temporary one won’t be accessible from that session that runs the Task.args – The arguments to call the stored procedure when
func
is aStoredProcedure
.return_type – A
DataType
representing the return data type of the stored procedure. Optional if type hints are provided.input_types – A list of
DataType
representing the input data types of the stored procedure. Optional if type hints are provided.stage_location – The stage location where the Python file for the anonymous stored procedure and its dependencies should be uploaded. It must be a permanent location because a Task will run in a different session than the session that creates the Task. A temporary one won’t be accessible from that session that runs the Task.
imports – A list of imports that only apply to this stored procedure. You can use a string to represent a file path (similar to the
path
argument inadd_import()
) in this list, or a tuple of two strings to represent a file path and an import path (similar to theimport_path
argument inadd_import()
). These stored procedure-level imports will override the session-level imports added byadd_import()
.packages – A list of packages that only apply to this stored procedure. These stored procedure-level packages will override the session-level packages added by
add_packages()
andadd_requirements()
.
Methods
- __init__(func: Callable[[...], Any] | StoredProcedure, *, args: List[Any] | None = None, return_type: DataType | None = None, input_types: List[DataType] | None = None, stage_location: str | None = None, imports: List[str | Tuple[str, str]] | None = None, packages: List[str | ModuleType] | None = None) None ¶