#NEWLINE# def _render_select( selections ) : #NEWLINE# #INDENT# 'Render the selection part of a query.\n\n    Parameters\n    ----------\n    selections : dict\n        Selections for a table\n\n    Returns\n    -------\n    str\n        A string for the "select" part of a query\n\n    See Also\n    --------\n    render_query : Further clarification of `selections` dict formatting\n    ' #NEWLINE# if ( not selections ) : #NEWLINE# #INDENT# return 'SELECT *' #NEWLINE# #UNINDENT# rendered_selections = [ ] #NEWLINE# for ( name , options ) in selections . items ( ) : #NEWLINE# #INDENT# if ( not isinstance ( options , list ) ) : #NEWLINE# #INDENT# options = [ options ] #NEWLINE# #UNINDENT# original_name = name #NEWLINE# for options_dict in options : #NEWLINE# #INDENT# name = original_name #NEWLINE# alias = options_dict . get ( 'alias' ) #NEWLINE# alias = ( ( 'as %s' % alias ) if alias else '' ) #NEWLINE# formatter = options_dict . get ( 'format' ) #NEWLINE# if formatter : #NEWLINE# #INDENT# name = _format_select ( formatter , name ) #NEWLINE# #UNINDENT# rendered_selections . append ( ( '%s %s' % ( name , alias ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return ( 'SELECT ' + ', ' . join ( rendered_selections ) )