def compile_attributes(bases, dependants, parameters, coalesce=None, label=None):
 context = SQLExpressionContext(bases, parameters, label=label)
 compiler = SQLExpressionCompiler()
 for attr in dependants:
  if (hasattr(attr, 'function') and attr.function):
   function_name = attr.function.lower()
   function = get_aggregate_function(function_name)
   column = function(attr, context, coalesce)
  else:
   column = compiler.compile(attr.expression, context)
  context.add_column(attr.ref, column)
 return context.columns

def compile_attributes ( bases , dependants , parameters , coalesce = None , label = None ) : context = SQLExpressionContext ( bases , parameters , label = label ) compiler = SQLExpressionCompiler ( ) for attr in dependants : if ( hasattr ( attr , 'function' ) and attr . function ) : function_name = attr . function . lower ( ) function = get_aggregate_function ( function_name ) column = function ( attr , context , coalesce ) else : column = compiler . compile ( attr . expression , context ) context . add_column ( attr . ref , column ) return context . columns
compile dependant attributes in dependants .