#33391: Clarify Aggregate.empty_result_set_value docs.
--------------------------------------+------------------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):
* stage: Unreviewed => Accepted
Comment:
`Aggregate.empty_result_set_value` defaults to `None` which is fine for
most (all?) aggregates, so I'd clarify this in docs, e.g.:
{{{#!diff
diff --git a/docs/ref/models/expressions.txt
b/docs/ref/models/expressions.txt
index 5ea7f9f0aa..208b810048 100644
--- a/docs/ref/models/expressions.txt
+++ b/docs/ref/models/expressions.txt
@@ -418,9 +418,8 @@ The ``Aggregate`` API is as follows:
.. versionadded:: 4.0
- Override
:attr:`~django.db.models.Expression.empty_result_set_value` to
- ``None`` since most aggregate functions result in ``NULL`` when
applied
- to an empty result set.
+ Defaults to ``None`` since most aggregate functions result in
``NULL``
+ when applied to an empty result set.
The ``expressions`` positional arguments can include expressions,
transforms of
the model field, or the names of model fields. They will be converted to
a
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33391#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.2786ff4d4134189bdd0ba50e7f4630b7%40djangoproject.com.