#34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN
are database-dependent.
-------------------------------------+-------------------------------------
     Reporter:  Matt Cooper          |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  4.1
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  floatfield           |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 So we have:

 > This is not obvious, and much like the "empty string vs null" discussion
 in CharField

 vs:

 > As for me it's a database caveat, and we cannot document all caveats in
 Django docs.

 I think I agree with the latter here.

 The `CharField` `blank`/`null` issue is something that's going to hit
 every user, pretty much immediately as they start using Django. It's worth
 documenting, and it even merits a whole `kwarg` and special handling in
 the field.

 In contrast (I think) storing `inf` and `NaN` are more specialised and
 advanced use cases. I look at
 [https://github.com/django/django/pull/16461/files#diff-
 fc688171203d4ce1e42c46f25bddfee5f494b0b1b81258907ff0531c81f2a4aeR1110-R1114
 the diff in the PR] and think that it's just not relevant to the vast
 majority of users. I think the particular SQLite callout is misplaced
 there. **Most though** I expect folks storing these values (as more
 specialised and advanced) to be writing tests checking the round-trip
 behaviour, in a way that we can't expect of the beginner hitting the
 `blank`/`null` issue with CharField.

 Floats are troublesome (granted). Maybe there's a cases for an addition to
 the [https://docs.djangoproject.com/en/4.1/ref/databases/#databases
 Databases doc] with the issue explained for each DB. With the proposed PR,
 what conclusion am I to take if I'm on PostgreSQL, or …? — write some
 tests and see?

 Happy to review such if you wanted to take it on Matt. Pending such, I
 think it's a `wontfix`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34260#comment:8>
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/01070185beb921ae-a2b72046-14d4-4ef4-b112-7b337a1a10c9-000000%40eu-central-1.amazonses.com.

Reply via email to