hyped.core.ops.mapping module¶
This module defines a collection of data processors that implement common mapping operations.
- class hyped.core.ops.mapping.MappingGetItem(*args: Any, **kwargs: Any)[source]¶
Bases:
BaseDataProcessor[MappingGetItemConfig]Processor to retrieve a value from a mapping based on a specified key.
This processor extracts the value associated with a given key from a mapping structure. The key is defined in the processor’s configuration.
- process(ctx: RunContext, mapping: _MappingFeature) wrapped_resolver, json_schema_input_type=PydanticUndefined)][source]¶
Retrieve a value from a mapping using a specified key.
- Parameters:
ctx (RunContext) – Context object containing runtime information.
mapping (Mapping) – Input mapping structure (e.g., dictionary-like or struct).
- Returns:
The value associated with the specified key in the mapping.
- Return type:
- class hyped.core.ops.mapping.MappingGetItemConfig(*, key: str)[source]¶
Bases:
BaseDataProcessorConfigConfiguration class for the
MappingGetItemprocessor.- model_config = {'extra': 'forbid', 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- hyped.core.ops.mapping.mapping_get_item(mapping: _MappingFeature, key: str) Feature | Any | list[Any] | Scalar | Array[source]¶
Retrieve a value from a mapping by key using the
MappingGetItemprocessor.This method retrieves the value associated with a given key in the mapping. If the key is not present in the mapping’s defined schema, an error is raised.