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 (Union[Callable[..., Any], StoredProcedure]) β
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 (List[Any], optional) β The arguments to call the stored procedure when
func
is aStoredProcedure
.return_type (DataType, optional) β A
DataType
representing the return data type of the stored procedure. Optional if type hints are provided.input_types (List[DataType], optional) β A list of
DataType
representing the input data types of the stored procedure. Optional if type hints are provided.stage_location (str, optional) β 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 (List[Union[str, Tuple[str, str]]], optional) β 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 (List[Union[str, ModuleType]], optional) β 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()
.