def base_columns_from_subquery(subquery):
    """Return non-aliased, base columns from subquery."""
    # base_columns is a set so we need to cast to list.
    return [(column, list(column.base_columns))
            for column in subquery.c.values()]