def validate_metadata_properties(
    metadata_properties: typing.Union[typing.List[AllowedMetadataPropertyTypes], None],
) -> None:
    """Validates that the metadata properties used in the filters are valid."""

    if not metadata_properties:
        return

    unique_names = set()
    for metadata_property in metadata_properties:
        if not isinstance(metadata_property, AllowedMetadataPropertyTypes.__args__):
            raise TypeError(
                f"Expected `metadata_properties` to be a list of"
                f" `{'`, `'.join([arg.__name__ for arg in AllowedMetadataPropertyTypes.__args__])}` got a"
                f" metadata property in the list with type type {type(metadata_property)} instead."
            )
        if metadata_property.name in unique_names:
            raise ValueError(
                f"Expected `metadata_properties` to have unique names, got '{metadata_property.name}' twice instead."
            )
        unique_names.add(metadata_property.name)
Validates that the metadata properties used in the filters are valid.
argilla-v1/src/argilla_v1/client/feedback/dataset/helpers.py