class hamilton.lifecycle.api.ResultBuilder#

Abstract class for building results. All result builders should inherit from this class and implement the build_result function. Note that applicable_input_type and output_type are optional, but recommended, for backwards compatibility. They let us type-check this. They will default to Any, which means that they’ll connect to anything.

abstract build_result(**outputs: Any) Any#

Given a set of outputs, build the result.


outputs – the outputs from the execution of the graph.


the result of the execution of the graph.

final do_build_result(outputs: Dict[str, Any]) Any#

Implements the do_build_result method from the BaseDoBuildResult class. This is kept from the user as the public-facing API is build_result, allowing us to change the API/implementation of the internal set of hooks

input_types() List[Type[Type]]#

Gives the applicable types to this result builder. This is optional for backwards compatibility, but is recommended.


A list of types that this can apply to.

output_type() Type#

Returns the output type of this result builder :return: the type that this creates