in src/fmeval/transforms/transform.py [0:0]
def register_input_output_keys(self, input_keys: List[str], output_keys: List[str], allow_duplicates: bool = False):
"""Assign self.input_keys and self.output_keys attributes.
Concrete subclasses of Transform should call this method in their __init__
if their __call__ method is decorated with `validate_call`.
:param input_keys: The record keys corresponding to data that this Transform
requires as inputs.
:param output_keys: The keys introduced by this Transform's __call__ logic
that will be present in the output record. If this Transform mutates its
input, then these keys should be added by __call__ to the input record.
:param allow_duplicates: Whether to allow duplicate values in `input_keys`.
"""
assert_condition(isinstance(input_keys, List), "input_keys should be a list.")
assert_condition(
all(isinstance(input_key, str) for input_key in input_keys),
"All keys in input_keys should be strings.",
)
if not allow_duplicates:
validate_key_uniqueness(input_keys)
assert_condition(isinstance(output_keys, List), "output_keys should be a list.")
assert_condition(len(output_keys) > 0, "output_keys should be a non-empty list.")
assert_condition(
all(isinstance(output_key, str) for output_key in output_keys),
"All keys in output_keys should be strings.",
)
validate_key_uniqueness(output_keys)
self.input_keys = input_keys
self.output_keys = output_keys