ResultBuilders

plugins.h_pyarrow.PyarrowTableResult

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

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

plugins.h_pyarrow.PyarrowTableResult

class hamilton.plugins.h_pyarrow.PyarrowTableResult[source]

Add this result builder to a materializer’s combine statement to convert your dataframe object to a pyarrow representation and make it compatible with pyarrow DataSavers.

It implicitly support input_type == Any, but it expects dataframe objects implementing the dataframe interchange protocol: ref: https://arrow.apache.org/docs/python/interchange_protocol.html for example: - pandas - polars - dask - vaex - ibis - duckdb results

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

This function converts objects implementing the __dataframe__ protocol to a pyarrow table. It doesn’t support receiving multiple outputs because it can’t handle any joining logic.

ref: https://arrow.apache.org/docs/python/interchange_protocol.html

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[source]

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

评论

登录后参与评论

正在加载评论…