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] = {}
) -> null
Parameters
| Name | Type | Description |
|---|---|---|
| _user_source | str = "" | The pre-transformed source code string to be executed. |
| _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 required by the task. |
Methods
forward()
def forward(self, *args, **kwargs) -> Any: ...
Not supported — there is no Python function to call directly.
Parameters
| Name | Type | Description |
|---|---|---|
| *args | Any | Positional arguments. |
| **kwargs | Any | Keyword arguments. |
Returns
| Type | Description |
|---|---|
Any | This method does not return as it always raises NotImplementedError. |