def _filter_validate(filepath, location, values, validate):
    """Generator for validate() results called against all given values. On
    errors, fields are warned about and ignored, unless strict mode is set in
    which case a compiler error is raised.
    """
    for value in values:
        if not isinstance(value, dict):
            warn_invalid(filepath, location, value, '(expected a dict)')
            continue
        try:
            yield validate(**value)
        except dbt.exceptions.JSONValidationException as exc:
            # we don't want to fail the full run, but we do want to fail
            # parsing this file
            warn_invalid(filepath, location, value, '- ' + exc.msg)
            continue