snowflake.core.code_bundle_execution.CodeBundleExecutionResource¶
- class snowflake.core.code_bundle_execution.CodeBundleExecutionResource(name: str, collection: CodeBundleExecutionCollection)¶
Bases:
CodeBundleExecutionResourceBaseRepresents a reference to a Snowflake code bundle execution.
A code bundle execution reference is identified by its execution id (the query id of the execution). With this reference you can fetch the execution’s status or cancel it.
Attributes
- root¶
The Root object this reference belongs to.
Methods
- cancel() SuccessResponse | SuccessAcceptedResponse¶
Cancel this code bundle execution.
- Returns:
The server’s response to the cancel request (a
SuccessResponsecarrying a status message).- Return type:
Examples
Cancelling an execution:
- cancel_async() PollingOperation[SuccessResponse | SuccessAcceptedResponse]¶
An asynchronous version of
cancel().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- execute_code_bundle(execute_code_bundle_request: ExecuteCodeBundleRequest, async_exec: bool | None = None) None¶
Execute a code bundle.
- Parameters:
execute_code_bundle_request (ExecuteCodeBundleRequest) – (required)
async_exec (bool) – Asynchronous execution enable/disable. Default is disable.
- execute_code_bundle_async(execute_code_bundle_request: ExecuteCodeBundleRequest, async_exec: bool | None = None) PollingOperation[None]¶
An asynchronous version of
execute_code_bundle().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- fetch_status() CodeBundleExecution¶
Fetch the status of this code bundle execution.
- Returns:
The status of the execution. If the server returns more than one matching record, the first one is returned.
- Return type:
- Raises:
NotFoundError – If no execution with this execution id exists.
Examples
Fetching the status of an execution:
- fetch_status_async() PollingOperation[CodeBundleExecution]¶
An asynchronous version of
fetch_status().Refer to
PollingOperationfor more information on asynchronous execution and the return type.