Re: [Django] #34972: Aggregate with CombinedExpression resulting in NotImplemented instead of None after update from 3.2 -> 4.2

2023-11-19 Thread Django
#34972: Aggregate with CombinedExpression resulting in NotImplemented instead of
None after update from 3.2 -> 4.2
-+-
 Reporter:  ElRoberto538 |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |   Resolution:
 Severity:  Normal   |  worksforme
 Keywords:  CombinedExpression,  | Triage Stage:
  NotImplemented, aggregate  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by ElRoberto538):

 We tried it in a different project and confirmed it worked, I expect this
 is an issue with the mssql-django DB connector.

-- 
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/0107018be9ab171a-ec62e8b7-7c03-4209-8ae5-ea791b48842e-00%40eu-central-1.amazonses.com.


Re: [Django] #34972: Aggregate with CombinedExpression resulting in NotImplemented instead of None after update from 3.2 -> 4.2

2023-11-17 Thread Django
#34972: Aggregate with CombinedExpression resulting in NotImplemented instead of
None after update from 3.2 -> 4.2
-+-
 Reporter:  ElRoberto538 |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |   Resolution:
 Severity:  Normal   |  worksforme
 Keywords:  CombinedExpression,  | Triage Stage:
  NotImplemented, aggregate  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by David Sanders):

 * cc: David Sanders (added)


-- 
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/0107018bdd932681-cf6e7e50-36ce-4dd2-8e44-0a2f8a50b2e6-00%40eu-central-1.amazonses.com.


Re: [Django] #34972: Aggregate with CombinedExpression resulting in NotImplemented instead of None after update from 3.2 -> 4.2

2023-11-16 Thread Django
#34972: Aggregate with CombinedExpression resulting in NotImplemented instead of
None after update from 3.2 -> 4.2
-+-
 Reporter:  ElRoberto538 |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |   Resolution:
 Severity:  Normal   |  worksforme
 Keywords:  CombinedExpression,  | Triage Stage:
  NotImplemented, aggregate  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 I think the issue is slightly more complicated than setting
 `empty_result_set_value = None` as I would expect

 {{{#!python
 
OurModel.objects.none().aggregate(random_aggregate=Count('field_2')/Count('field_2'))['random_aggregate']
 }}}

 To return `{"random_aggregate": 0}`.

 The fact `NotImplemented` is returned here is problematic though and I
 assume you have some third party apps that interacts with query
 compilation in a way that does not account for the fact that an aggregate
 that doesn't implement `empty_result_set_value` from an empty query should
 be evaluated by the database.

-- 
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/0107018bdbf1bde3-c59da091-c539-4fbf-be19-5d944a3b745f-00%40eu-central-1.amazonses.com.


Re: [Django] #34972: Aggregate with CombinedExpression resulting in NotImplemented instead of None after update from 3.2 -> 4.2

2023-11-16 Thread Django
#34972: Aggregate with CombinedExpression resulting in NotImplemented instead of
None after update from 3.2 -> 4.2
-+-
 Reporter:  ElRoberto538 |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |   Resolution:
 Severity:  Normal   |  worksforme
 Keywords:  CombinedExpression,  | Triage Stage:
  NotImplemented, aggregate  |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Natalia Bidart):

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


Comment:

 Hello, thank you for your report.

 Could you please provide more details to help us triage this ticket? With
 the given information I can't reproduce the exception (I used a simple
 model I created for this report).
 Specifically, we'd need:
 1. Your model definitions to exercise the provided query
 2. The exact exception you are getting

 Feel free to re-open when you can provide further details.

-- 
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/0107018bdb033284-ce5848e1-c7b6-43b0-817e-936524114fb6-00%40eu-central-1.amazonses.com.


[Django] #34972: Aggregate with CombinedExpression resulting in NotImplemented instead of None after update from 3.2 -> 4.2

2023-11-16 Thread Django
#34972: Aggregate with CombinedExpression resulting in NotImplemented instead of
None after update from 3.2 -> 4.2
-+-
   Reporter: |  Owner:  nobody
  ElRoberto538   |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  4.2
  layer (models, ORM)|   Keywords:  CombinedExpression,
   Severity:  Normal |  NotImplemented, aggregate
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Hi we're currently updating to Django 4.2 before 3.2 extended support
 ends, and have discovered a weird issue with some of our queries. Using
 3.2 our simplified example query below would return None, now it returns
 NotImplemented, is this expected behavior? Shouldn't CombinedExpression
 have empty_result_set_value set to None to maintain existing behavior?


 {{{
 
OurModel.objects.none().aggregate(random_aggregate=Sum('field_1')/Count('field_2'))['random_aggregate']
 }}}

-- 
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/0107018bdaed3634-229ec673-6926-45f1-8a45-3363f18fe0eb-00%40eu-central-1.amazonses.com.