Lifecycle Adapters

lifecycle.LegacyResultMixin

qianmoQqianmoQ· 更新于 2026-10-09· 阅读 3 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

lifecycle.LegacyResultMixin

class hamilton.lifecycle.api.LegacyResultMixin[source]

Backwards compatible legacy result builder. This utilizes a static method as we used to do that, although often times they got confused. If you want a result builder, use ResultBuilder above instead.

static build_result(**outputs: Any) → Any[source]

Given a set of outputs, build the result.

Parameters:

outputs – the outputs from the execution of the graph.

Returns:

the result of the execution of the graph.

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.

Returns:

A list of types that this can apply to.

output_type() → type

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

评论

登录后参与评论

正在加载评论…