def _render_having(having_conditions):
    """Render the having part of a query.

    Parameters
    ----------
    having_conditions : list
        A ``list`` of ``dict``s to filter the rows

    Returns
    -------
    str
        A string that represents the "having" part of a query.

    See Also
    --------
    render_query : Further clarification of `conditions` formatting.
    """
    if not having_conditions:
        return ""

    rendered_conditions = []

    for condition in having_conditions:
        field = condition.get('field')
        field_type = condition.get('type')
        comparators = condition.get('comparators')

        if None in (field, field_type, comparators) or not comparators:
            logger.warn('Invalid condition passed in: %s' % condition)
            continue

        rendered_conditions.append(
            _render_condition(field, field_type, comparators))

    if not rendered_conditions:
        return ""

    return "HAVING %s" % (" AND ".join(rendered_conditions))
Render the having part of a query.

    Parameters
    ----------
    having_conditions : list
        A ``list`` of ``dict``s to filter the rows

    Returns
    -------
    str
        A string that represents the "having" part of a query.

    See Also
    --------
    render_query : Further clarification of `conditions` formatting.