SimplePythonDataFrameGraphAdapter#
- class hamilton.base.SimplePythonDataFrameGraphAdapter#
This is the original Hamilton graph adapter. It uses plain python and builds a dataframe result.
This executes the Hamilton dataflow locally on a machine in a single threaded, single process fashion. It assumes a pandas dataframe as a result.
Use this when you want to execute on a single machine, without parallelization, and you want a pandas dataframe as output.
- static check_input_type(node_type: Type, input_value: Any) bool #
Used to check whether the user inputs match what the execution strategy & functions can handle.
- Parameters:
node_type β The type of the node.
input_value β An actual value that we want to inspect matches our expectation.
- Returns:
- static check_node_type_equivalence(node_type: Type, input_type: Type) bool #
Used to check whether two types are equivalent.
This is used when the function graph is being created and weβre statically type checking the annotations for compatibility.
- Parameters:
node_type β The type of the node.
input_type β The type of the input that would flow into the node.
- Returns:
- execute_node(node: Node, kwargs: Dict[str, Any]) Any #
Given a node that represents a hamilton function, execute it. Note, in some adapters this might just return some type of βfutureβ.
- Parameters:
node β the Hamilton Node
kwargs β the kwargs required to exercise the node function.
- Returns:
the result of exercising the node.