def _render_select(selections):

    if not selections:
        return 'SELECT *'

    rendered_selections = []
    for name, options in selections.items():
        if not isinstance(options, list):
            options = [options]

        original_name = name
        for options_dict in options:
            name = original_name
            alias = options_dict.get('alias')
            alias = "as %s" % alias if alias else ""

            formatter = options_dict.get('format')
            if formatter:
                name = _format_select(formatter, name)

            rendered_selections.append("%s %s" % (name, alias))

    return "SELECT " + ", ".join(rendered_selections)
Render the selection part of a query.
dataset/ETHPy150Open tylertreat/BigQuery-Python/bigquery/query_builder.py/_render_select