def _render_order(order):
    """Render the order by part of a query.

    Args:
        order: a dictionary with two keys, field and direction.
            Such that the dictionary should be formatted as
            {'field':'TimeStamp, 'direction':'desc'}.

    Returns:
        a string that represents the order by part of a query.
    """

    if not order or 'field' not in order or 'direction' not in order:
        return ''

    return "ORDER BY %s %s" % (order['field'], order['direction'])