#29139: Aggregate functions failing when using Postgres JSON field KeyTransform
-------------------------------------+-------------------------------------
Reporter: trik | Owner: ddio
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 2.0
Severity: Normal | Resolution:
Keywords: json keytransform | Triage Stage: Accepted
unhashable |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by ddio):
* status: new => assigned
* owner: (none) => ddio
Comment:
I resolve this issue when digging into nested KeyTransform.
== Root Cause
1. When using nested KeyTransform, it concatenate child keys in the wrong
format, i.e. a list `[child1, child2]`
2. Instead, according to pgsql, it should be a string like `'{child1,
child2, ...}'`
== Solution
After updating the as_sql() transformation, the issue is resolved. Will
send PR soon.
--
Ticket URL: <https://code.djangoproject.com/ticket/29139#comment:4>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/062.bed40c81671e3fce9b09a3fe911e22f2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.