hyped.core.nodes.const module

This module defines the ConstNode.

The ConstNode class is a specialized node that holds a constant value defined in its configuration. Unlike other nodes in the data flow graph, the ConstNode does not process input or dynamically compute outputs. Instead, it serves as a static reference for constant data.

class hyped.core.nodes.const.ConstNode(config: None | U = None, **kwargs)[source]

Bases: BaseNode[ConstNodeConfig]

A constant node in the processing pipeline.

call(*args: Any, **kwargs: Any) Any[source]

Raises an error, as direct calls are not supported for this node.

property signature: Any

Raises an error, as signature is not supported for this node.

class hyped.core.nodes.const.ConstNodeConfig(*, value: ~pyarrow.lib.Annotated[~pyarrow.lib.Array, ~pydantic.functional_serializers.PlainSerializer(func=~hyped.core.nodes.const.ConstNodeConfig.<lambda>, return_type=PydanticUndefined, when_used=always), ~pydantic.functional_validators.BeforeValidator(func=~hyped.core.nodes.const.ConstNodeConfig.<lambda>, json_schema_input_type=PydanticUndefined)])[source]

Bases: BaseNodeConfig

Configuration for a constant node.

model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

value: <lambda>, json_schema_input_type=PydanticUndefined)]

A PyArrow array representing the constant value.

This field supports custom serialization and deserialization logic:
  • Serialization: Converts the array to a dictionary containing the constant (value) and its data type (dtype).

  • Deserialization: Parses input into a PyArrow array based on the provided value and data type.