def _validate_record_metadata(record: FeedbackRecord, metadata_schema: typing.Type[BaseModel] = None) -> None:
    """Validates the `FeedbackRecord.metadata` against the schema defined by the `metadata_properties`."""

    if not record.metadata:
        return

    try:
        metadata_schema.parse_obj(record.metadata)
    except ValidationError as e:
        raise ValueError(
            f"`FeedbackRecord.metadata` {record.metadata} does not match the expected schema," f" with exception: {e}"
        ) from e
Validates the `FeedbackRecord.metadata` against the schema defined by the `metadata_properties`.
argilla-v1/src/argilla_v1/client/feedback/dataset/helpers.py