ExtraDataBatcher (autotransform.batcher.extradata)
The implementation for the ExtraDataBatcher.
- class autotransform.batcher.extradata.ExtraDataBatcher(*, group_by: str, metadata_keys: ~typing.List[str] = <factory>)
Bases:
BatcherA Batcher which uses the extra data on Items to create batches.
- group_by
The key of the extra_data on items to group Items by for Batches.
- Type:
str
- metadata_keys
A list of keys from Items to combine in to the metadata of a batch. Defaults to [].
- Type:
optional, List[str]
- name
The name of the Component.
- Type:
ClassVar[BatcherName]
- batch(items: Sequence[Item]) List[Batch]
Take filtered Items and group them by an extra_data value.
- group_by: str
- metadata_keys: List[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: ClassVar[BatcherName] = 'extra_data'