def METHOD_NAME(self, data):
    start = data["table"].get_starting_object(self.context["info"])
    data_source = data["data_source"]
    try:
        field = start.get_field(data_source.split("."))
    except KeyError:
        raise exceptions.ValidationError(
            {
                "dataSource": [
                    f"Specified data source '{data_source}' is not available"
                ]
            }
        )
    if not field.is_value():
        raise exceptions.ValidationError(
            {
                "dataSource": [
                    f"Specified data source '{data_source}' is "
                    "not a value field. Select a subfield."
                ]
            }
        )
    function = data["function"].upper()
    if function not in field.supported_functions():
        raise exceptions.ValidationError(
            {"function": [f"Function '{function}' is not supported on this field"]}
        )