#34255: Annotation/group by with an expression on psycopg3
-------------------------------------+-------------------------------------
Reporter: Guillaume Andreu | Owner: nobody
Sabater |
Type: Bug | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: orm postgres | Triage Stage: Accepted
psycopg3 annotation groupby |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* cc: Florian Apolloner, Simon Charette (added)
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. I was to able to reproduce the issue without
`SubqueryArray()` and with built-in `JSONObject`:
{{{#!python
@override_settings(USE_TZ=True)
def test_group_by_crash(self):
tz = zoneinfo.ZoneInfo("Europe/Paris")
qs = Point.objects.annotate(
year=ExtractYear("start_at", tzinfo=tz),
).values("year").annotate(
baseload=Avg("value"),
json=JSONObject(
year=F("year"),
baseload=F("baseload"),
)
).values("json")
list(qs)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34255#comment:1>
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/01070185a60e4225-f2b68585-0193-460e-8e8c-3b0cb9c59a6b-000000%40eu-central-1.amazonses.com.