plugins.h_pyarrow.PyarrowTableResult¶

class hamilton.plugins.h_pyarrow.PyarrowTableResult¶

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¶

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¶

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