Skip to main content

SandboxedTaskTemplate

A task template that executes the function body in a Monty sandbox.

Attributes

AttributeTypeDescription
task_typestr = "sandboxed-python"The identifier for the task execution environment, set to "sandboxed-python" to trigger Monty sandbox execution.
plugin_configOptional[[SandboxedConfig](../config/sandboxedconfig.md?sid=flyte_sandbox__config_sandboxedconfig)] = nullConfiguration settings for the sandboxed environment, defaulting to a standard SandboxedConfig if not provided.

Constructor

Signature

def SandboxedTaskTemplate()

Methods


execute()

@classmethod
def execute(
*args: Any,
**kwargs: Any
) - > Any

Execute the function body in a Monty sandbox.

Parameters

NameTypeDescription
*argsAnyPositional arguments to be passed to the sandboxed function.
**kwargsAnyKeyword arguments to be passed to the sandboxed function.

Returns

TypeDescription
AnyThe result of the sandboxed function execution after processing pre and post hooks.

forward()

@classmethod
def forward(
*args: Any,
**kwargs: Any
) - > Any

Bypass Monty and call the function directly (for local/debug execution).

Parameters

NameTypeDescription
*argsAnyPositional arguments to pass directly to the underlying function.
**kwargsAnyKeyword arguments to pass directly to the underlying function.

Returns

TypeDescription
AnyThe direct return value of the underlying Python function.