Re: [Django] #34706: Aggregation on annotated field fails starting on Django 4.2.2, when the aggregation has the same name as the annotation

11 views
Skip to first unread message

Django

unread,
Jul 11, 2023, 10:20:40 AM7/11/23
to django-...@googlegroups.com
#34706: Aggregation on annotated field fails starting on Django 4.2.2, when the
aggregation has the same name as the annotation
-------------------------------+--------------------------------------
Reporter: Lorenzo Peña | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Simon Charette):

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


Comment:

Duplicate of #31679. This Django 4.2 ''feature'' had to be be reverted in
Django 4.2.1 has it caused regressions in other areas.

--
Ticket URL: <https://code.djangoproject.com/ticket/34706#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 19, 2023, 3:03:01 AM9/19/23
to django-...@googlegroups.com
#34706: Aggregation on annotated field fails starting on Django 4.2.2, when the
aggregation has the same name as the annotation
-------------------------------+--------------------------------------
Reporter: Lorenzo Peña | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Lorenzo Peña):

Good day everyone! I see this is still broken in Django 5.0a1. What is the
expected course of action from our side?

--
Ticket URL: <https://code.djangoproject.com/ticket/34706#comment:3>

Django

unread,
Sep 19, 2023, 3:10:47 AM9/19/23
to django-...@googlegroups.com
#34706: Aggregation on annotated field fails starting on Django 4.2.2, when the
aggregation has the same name as the annotation
-------------------------------+--------------------------------------
Reporter: Lorenzo Peña | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:3 Lorenzo Peña]:


> Good day everyone! I see this is still broken in Django 5.0a1. What is
the expected course of action from our side?

You can prepare a patch for #31679.

--
Ticket URL: <https://code.djangoproject.com/ticket/34706#comment:4>

Django

unread,
Sep 19, 2023, 3:30:44 AM9/19/23
to django-...@googlegroups.com
#34706: Aggregation on annotated field fails starting on Django 4.2.2, when the
aggregation has the same name as the annotation
-------------------------------+--------------------------------------
Reporter: Lorenzo Peña | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Lorenzo Peña):

Marius, I apologize if I sounded demanding or challenging. Let me try
again.

The behavior reported here started happening in the patch release 4.2.2.
The code where it's breaking for me used to work properly in 4.2.0 and
4.2.1. I was expecting either a fix in the 4.2 series, or in the 5.0
series, or at least a resolution in the form of documentation. In my code
I have the Django version pinned to 4.2.1. I would like to make a decision
on whether to continue waiting, or changing my code to not use the same
name in the annotation and the aggregation. When I asked what the
"expected course of action from our side" was, I was referring to that.

I really wish I could do more to Django, but I lack the in-depth knowledge
to do so. Unfortunately, preparing a patch is not a viable option for me.
I can, however, change my own codebase so that it doesn't have the
breaking behavior, which from your response I assume I should do.

--
Ticket URL: <https://code.djangoproject.com/ticket/34706#comment:5>

Django

unread,
Sep 19, 2023, 3:40:21 AM9/19/23
to django-...@googlegroups.com
#34706: Aggregation on annotated field fails starting on Django 4.2.2, when the
aggregation has the same name as the annotation
-------------------------------+--------------------------------------
Reporter: Lorenzo Peña | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Mariusz Felisiak):

> The behavior reported here started happening in the patch release 4.2.2.
The code where it's breaking for me used to work properly in 4.2.0 and
4.2.1. I was expecting either a fix in the 4.2 series, or in the 5.0
series, or at least a resolution in the form of documentation. In my code
I have the Django version pinned to 4.2.1. I would like to make a decision
on whether to continue waiting, or changing my code to not use the same
name in the annotation and the aggregation. When I asked what the
"expected course of action from our side" was, I was referring to that.

Fix for #31679 was reverted in Django 4.2.2 because it introduces a
regression. We cannot fix bugs by introducing different bugs. #31679 will
not be fixed in Django 4.2.X.

> I would like to make a decision on whether to continue waiting, or
changing my code to not use the same name in the annotation and the
aggregation.

I'd recommend changing your code.

--
Ticket URL: <https://code.djangoproject.com/ticket/34706#comment:6>

Reply all
Reply to author
Forward
0 new messages