CodeTaskTemplate
A sandboxed task created from a code string rather than a decorated function. Unlike SandboxedTaskTemplate (which extracts source from a Python function), this class accepts pre-transformed source code and an explicit dict of external functions. It is constructed via flyte.sandbox.orchestrator_from_str.
Constructor
Signature
def CodeTaskTemplate(
_user_source: str,
_user_input_names: List[str] = [],
_user_functions: Dict[str, Any] = {}
)
Parameters
| Name | Type | Description |
|---|---|---|
| _user_source | str | The pre-transformed source code string for the task. |
| _user_input_names | List[str] = [] | A list of names for the task's input parameters. |
| _user_functions | Dict[str, Any] = {} | A dictionary mapping names to external function objects used within the source code. |
Methods
forward()
@classmethod
def forward(
*args: Any,
**kwargs: Any
) - > Any
Not supported — there is no Python function to call directly.
Parameters
| Name | Type | Description |
|---|---|---|
| *args | Any | Positional arguments intended for the task execution. |
| **kwargs | Any | Keyword arguments intended for the task execution. |
Returns
| Type | Description |
|---|---|
Any | This method does not return as it always raises a NotImplementedError. |