MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / visit_aggregateorderby

Method visit_aggregateorderby

lib/sqlalchemy/sql/compiler.py:3040–3059  ·  view source on GitHub ↗
(self, aggregateorderby, **kwargs)

Source from the content-addressed store, hash-verified

3038 )
3039
3040 def visit_aggregateorderby(self, aggregateorderby, **kwargs):
3041 if self.dialect.aggregate_order_by_style is AggregateOrderByStyle.NONE:
3042 raise exc.CompileError(
3043 "this dialect does not support "
3044 "ORDER BY within an aggregate function"
3045 )
3046 elif (
3047 self.dialect.aggregate_order_by_style
3048 is AggregateOrderByStyle.INLINE
3049 ):
3050 new_fn = aggregateorderby.element._clone()
3051 new_fn.clause_expr = elements.Grouping(
3052 aggregate_orderby_inline(
3053 new_fn.clause_expr.element, aggregateorderby.order_by
3054 )
3055 )
3056
3057 return new_fn._compiler_dispatch(self, **kwargs)
3058 else:
3059 return self.visit_withingroup(aggregateorderby, **kwargs)
3060
3061 def visit_aggregate_orderby_inline(self, element, **kw):
3062 return "%s ORDER BY %s" % (

Callers

nothing calls this directly

Calls 4

visit_withingroupMethod · 0.95
_cloneMethod · 0.45
_compiler_dispatchMethod · 0.45

Tested by

no test coverage detected