#34564: returning None instead of zero in Count annotation
-------------------------------------+-------------------------------------
     Reporter:  Amin Aminian         |                    Owner:  Amin
                                     |  Aminian
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     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 Amin Aminian):

 Hi again.
 I was trying to write a regression test that I faced an issue.
 Apparently, `Count` function is returning 0 usually. But I was unlucky
 enough to face some situations that `Count` return `None`.

 One situation is during my tests, when using `Timescaledb` (Postgres
 extension). In this scenario, I'm getting `None` instead of 0 when using
 `Count`.
 And the another situation is on production server, when some complicated
 queries are executed and I'm getting None there too. I cannot find out why
 that leads to `None`, as I get 0 when using similar queries.

 So I'm basically asking, do you know some simple scenarios that DB would
 return None ? (I suppose the old `convert_value` function was there for
 those scenarios)

 And if your not, is it valid to use `Timescaledb` in test ? (Actually I
 have written such a test already for TDD development during this PR)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34564#comment:18>
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/0107018859cd7caa-687b54be-bafb-430e-846e-79b345a704fe-000000%40eu-central-1.amazonses.com.

Reply via email to