Skip to content #

    fn: Callable[..., Dict[str, EventSetOrNode]],
    path: str,
    *args: Union[EventSetNode, EventSet, Schema],
    **kwargs: Union[EventSetNode, EventSet, Schema]
) -> None

Saves a compiled Temporian function to a file.

The saved function must only take EventSetOrNodes as arguments, return a dictionary of names to EventSetOrNodes, and be decorated with @tp.compile.

Temporian saves the graph built between the function's input and output nodes, not the function itself. Any arbitrary code that is executed in the function will not be ran when loading it back up and executing it.

If you need to save a function that additionally takes other types of arguments, try using functools.partial to create a new function that takes only EventSetNodes, and save that instead. Note that the partial function needs to be compiled too, with tp.compile(partial(...)).


Name Type Description Default
fn Callable[..., Dict[str, EventSetOrNode]]

The function to save.

path str

The path to save the function to.

args Union[EventSetNode, EventSet, Schema]

Positional arguments to pass to the function to trace it. The arguments can be either EventSets, EventSetNodes, or raw Schemas. In all cases, the values will be converted to EventSetNodes before being passed to the function to trace it.

kwargs Union[EventSetNode, EventSet, Schema]

Keyword arguments to pass to the function to trace it. Same restrictions as for args.



Type Description

If the received function is not compiled.


If any of the received inputs is not of the specified types.


If the function doesn't return the specified type.