#34808: Some aggregation functions may return None; this isn't well documented
--------------------------------------+------------------------------------
Reporter: Eric Baumgartner | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 4.2
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
--------------------------------------+------------------------------------
Comment (by Eric Baumgartner):
Ah, thanks, I completely missed that `default` was an option. (In 4.0, at
least -- I"m still working with some 3.2 projects.)
I'm happy to take a shot at some documentation changes. I haven't
contributed to Django before, so if you have any pointers for newbies I'd
appreciate it.
Now that I've reviewed #10929 (and I know what to look for) I think
coverage is better than I'd originally thought. I think the main things
I'd address include:
- Reviewing all example code across pages that uses `.aggregate(...)` and
adding an explicit `default` param or `None` handling when appropriate. I
think this is important because many people grab the sample code and don't
read additional documentation.
- On the aggregation topic page specifically, add a new section ("Handling
empty querysets"?) that discusses `default` and explains that it uses
Coalesce under the hood.
- Add something to the documentation of `Aggregation.default` on the
querysets page mentioning that it uses Coalesce under the hood.
Does that scope make sense?
I think mentioning Coalesce is helpful because it provides a hint for
pre-4 users who can't use `default`. Is that sort of thing OK? I don't
know what the project's position is on mentioning stuff that only applies
to older versions.
Somewhat related, should the documentation for `default` have a "New in
4.0" flag? Or are those flags reserved for just changed in the last
release or two?
--
Ticket URL: <https://code.djangoproject.com/ticket/34808#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/0107018a56b633d4-ae693958-e2de-4833-ba5e-287ff396aaaa-000000%40eu-central-1.amazonses.com.