#34564: returning None instead of zero in Count annotation
-------------------------------------+-------------------------------------
Reporter: Amin Aminian | Owner: Amin
| Aminian
Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: count, orm, | Triage Stage: Accepted
annotate |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by David Sanders):
[https://www.postgresql.org/docs/current/functions-aggregate.html PG docs
confirms] that `count(<expression>)` must always return a result as it
counts the number of rows for which `<expression>` is not null:
> count ( "any" ) → bigint
>
> Computes the number of input rows in which the input value is not null.
My advice would be to confirm this isn't documented behaviour with
Timescale, if it isn't then report the issue ¯\_(ツ)_/¯.
--
Ticket URL: <https://code.djangoproject.com/ticket/34564#comment:22>
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/0107018865ea75a7-2db0ca51-e7ab-433f-b844-fbd0474d3926-000000%40eu-central-1.amazonses.com.