Leaklens

django__django-13569

order_by('?') unexpectedly breaking queryset aggregation

Verdict: the fix is stated in the issue (Tier A).

Patch to SQLCompiler.get_group_by that excluds Random expressions

The text states the fix: “I patched it like this for expr, (sql, params, is_ref) in order_by: if expr.contains_aggregate: continue if is_ref: continue expressions.extend([ exp for exp in expr.get…”

All SWE-bench Verified tasks · more django/django tasks · How the check works