Re: [Django] #35257: db.models.expressions _connector_combinations for Numeric with NULL returns only FloatField instead of (IntegerField, DecimalField, FloatField)

2024-03-21 Thread Django
#35257: db.models.expressions _connector_combinations for Numeric with NULL 
returns
only FloatField instead of (IntegerField, DecimalField, FloatField)
-+-
 Reporter:  Sharon Woo   |Owner:  Sharon
 |  Woo
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * resolution:   => fixed
 * status:  assigned => closed

Comment:

 In [changeset:"6a37e9bfae42eb180a8c978a3ade5b41c97c26b1" 6a37e9b]:
 {{{#!CommitTicketReference repository=""
 revision="6a37e9bfae42eb180a8c978a3ade5b41c97c26b1"
 Fixed #35257 -- Corrected resolving output_field for
 IntegerField/DecimalField with NULL.
 }}}
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e606af903-ffd18207-ecce-4b83-b14c-5bf09225eaeb-00%40eu-central-1.amazonses.com.


Re: [Django] #35257: db.models.expressions _connector_combinations for Numeric with NULL returns only FloatField instead of (IntegerField, DecimalField, FloatField)

2024-03-21 Thread Django
#35257: db.models.expressions _connector_combinations for Numeric with NULL 
returns
only FloatField instead of (IntegerField, DecimalField, FloatField)
-+-
 Reporter:  Sharon Woo   |Owner:  Sharon
 |  Woo
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  1 => 0
 * stage:  Accepted => Ready for checkin

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e6015841e-6d055508-ebf2-4dc5-910e-389e7746c012-00%40eu-central-1.amazonses.com.


Re: [Django] #35257: db.models.expressions _connector_combinations for Numeric with NULL returns only FloatField instead of (IntegerField, DecimalField, FloatField)

2024-03-07 Thread Django
#35257: db.models.expressions _connector_combinations for Numeric with NULL 
returns
only FloatField instead of (IntegerField, DecimalField, FloatField)
-+-
 Reporter:  Sharon Woo   |Owner:  Sharon
 |  Woo
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 1

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e1c8affa7-f6f2210b-162a-45b3-bfe1-873ea9f801e8-00%40eu-central-1.amazonses.com.


Re: [Django] #35257: db.models.expressions _connector_combinations for Numeric with NULL returns only FloatField instead of (IntegerField, DecimalField, FloatField)

2024-02-28 Thread Django
#35257: db.models.expressions _connector_combinations for Numeric with NULL 
returns
only FloatField instead of (IntegerField, DecimalField, FloatField)
-+-
 Reporter:  Sharon Woo   |Owner:  Sharon
 |  Woo
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sharon Woo):

 * has_patch:  0 => 1

Comment:

 [https://github.com/django/django/pull/17916 PR] in progress, comments
 very welcome.
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018df0cd0920-0d94b957-2649-40dd-a96d-8177efcc3db0-00%40eu-central-1.amazonses.com.


Re: [Django] #35257: db.models.expressions _connector_combinations for Numeric with NULL returns only FloatField instead of (IntegerField, DecimalField, FloatField)

2024-02-27 Thread Django
#35257: db.models.expressions _connector_combinations for Numeric with NULL 
returns
only FloatField instead of (IntegerField, DecimalField, FloatField)
-+-
 Reporter:  Sharon Woo   |Owner:  Sharon
 |  Woo
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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 Sharon Woo):

 * owner:  nobody => Sharon Woo

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018deb03b120-7139285e-733c-4903-bce9-de7173d7553e-00%40eu-central-1.amazonses.com.


Re: [Django] #35257: db.models.expressions _connector_combinations for Numeric with NULL returns only FloatField instead of (IntegerField, DecimalField, FloatField)

2024-02-27 Thread Django
#35257: db.models.expressions _connector_combinations for Numeric with NULL 
returns
only FloatField instead of (IntegerField, DecimalField, FloatField)
-+-
 Reporter:  Sharon Woo   |Owner:  nobody
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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 David Sanders):

 * stage:  Unreviewed => Accepted

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018deb032167-05aeec4d-d4f2-4bde-aed7-354d58e95d27-00%40eu-central-1.amazonses.com.


[Django] #35257: db.models.expressions _connector_combinations for Numeric with NULL returns only FloatField instead of (IntegerField, DecimalField, FloatField)

2024-02-27 Thread Django
#35257: db.models.expressions _connector_combinations for Numeric with NULL 
returns
only FloatField instead of (IntegerField, DecimalField, FloatField)
-+-
   Reporter:  Sharon |  Owner:  nobody
  Woo|
   Type:  Bug| Status:  assigned
  Component:  Database   |Version:  5.0
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Discovered via writing tests for this related ticket with a LOT of help
 from David Sanders -- https://code.djangoproject.com/ticket/35235.

 In
 
https://github.com/django/django/blob/ef2434f8508551fee183079ab471b1dc325c7acb/django/db/models/expressions.py#L599-L613
 via https://github.com/django/django/pull/15271,

 the dictionary comprehension below

 {{{
  {
 connector: [
 (field_type, NoneType, field_type),
 (NoneType, field_type, field_type),
 ]
 for connector in (
 Combinable.ADD,
 Combinable.SUB,
 Combinable.MUL,
 Combinable.DIV,
 Combinable.MOD,
 Combinable.POW,
 )
 for field_type in (fields.IntegerField, fields.DecimalField,
 fields.FloatField)
 },
 }}}

 returns

 {{{
 Combinable.ADD: [(fields.FloatField, NoneType, fields.FloatField),
  (NoneType, fields.FloatField, fields.FloatField),],
 Combinable.SUB: [(fields.FloatField, NoneType, fields.FloatField),
  (NoneType, fields.FloatField, fields.FloatField),],
 ...
 }}}

 instead of the expected

 {{{
 Combinable.ADD: [(fields.IntegerField, NoneType, fields.IntegerField),
  (NoneType, fields.IntegerField, fields.IntegerField),
  (fields.DecimalField, NoneType, fields.DecimalField),
  (NoneType, fields.DecimalField, fields.DecimalField),
  (fields.FloatField, NoneType, fields.FloatField),
  (NoneType, fields.FloatField, fields.FloatField),
  ],
 ...
 }}}

 This leads to only FloatField throwing FieldError with
 `_output_field_or_none` when fields are combined with NULL.

 Examples you can run right now:

 {{{
 original_dict_comp = {
 connector: (
 (field_type, None, field_type),
 (None, field_type, field_type),
 )
 for connector in (
 'ADD', 'SUB', 'MUL', 'DIV', 'MOD', 'POW',
 )
 for field_type in ('IntegerField', 'DecimalField', 'FloatField')
 }

 # there are a few ways to write this one
 fixed_dict_comp = {
 key: [
 (field_type, None, field_type)
 for field_type in ['IntegerField', 'DecimalField', 'FloatField']
 ] + [
 (None, field_type, field_type)
 for field_type in ['IntegerField', 'DecimalField', 'FloatField']
 ]
 for key in ['ADD', 'SUB', 'MUL', 'DIV', 'MOD', 'POW']
 }
 }}}
-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018deb01a45f-38acd234-46f9-4c58-955d-60649ebb623d-00%40eu-central-1.amazonses.com.