def METHOD_NAME(
    key: Union[DistinctField, SearchField, TracklistField],
    arg: QueryValue,
    msg: str,
) -> None:
    if not isinstance(arg, str) or not arg.strip():
        raise exceptions.ValidationError(msg.format(arg=arg, key=key))