def check_var_in_md(var: str, columns: list, messages: list) -> bool:
    """Checks that variable is in the metadata.

    Parameters
    ----------
    var : str
        Metadata variable in criteria.
    columns : list
        Metadata variables in table.
    messages : list
        Message to print in case of error.

    Returns
    -------
    boolean : bool
        Whether to keep the key/value or not.

    """
    if var not in columns:
        messages.append('Variable %s not in metadata (skipped)' % var)
        return True
    return False