For what it's worth, I'm trying to filter out all of the empty values in
an `ArrayAgg` expression, which seems to be a fairly common thing that one
would want to do. Perhaps we could add an example to the documentation
showing how that can be accomplished. I'm not sure right now if the
`filter` keyword argument is the way to go.
--
Ticket URL: <https://code.djangoproject.com/ticket/29317>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
The relevant commit is b78d100fa62cd4fbbc70f2bae77c192cb36c1ccd. I don't
think it makes much sense to repeat the documentation for `filter` in
every aggregate subclass. Ideas?
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:1>
Comment (by Matthew Pava):
I agree. I just found the documentation here:
https://docs.djangoproject.com/en/2.0/topics/db/aggregation/#filtering-on-
annotations
Honestly, though, even that little note seems a little buried in
everything.
Maybe we can add a link to the generic aggregation documentation on the
PostgreSQL aggregation documentation?
And, I think I found a bug. I keep getting this error when using a filter
`Q` object with `ArrayAgg`:
`AttributeError: 'WhereNode' object has no attribute
'_output_field_or_none'`
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:2>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:3>
* cc: Tom Forbes (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:4>
* owner: nobody => shalgrim
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:5>
Comment (by shalgrim):
proposed fix here https://github.com/shalgrim/django/tree/ticket_29317
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:6>
Comment (by Tom Forbes):
Hey shalgrim, can you make a pull request to the Django project with this?
If you visit https://github.com/django/django you should see a button to
do this
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:7>
Comment (by Vishvajit Pathak):
I have created a PR at https://github.com/django/django/pull/10548
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:8>
Comment (by Scott Halgrim):
Oh I'm sorry guys. Two things. I had meant to link to my PR before:
https://github.com/django/django/pull/10530
And I just saw Tom's comment right now.
Again, sorry for the confusion.
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"7e9d5a0aca23427d431a6628b0593c26d087658f" 7e9d5a0a]:
{{{
#!CommitTicketReference repository=""
revision="7e9d5a0aca23427d431a6628b0593c26d087658f"
[2.1.x] Fixed #29317 -- Doc'd filter argument in contrib.postgres
aggregates.
Backport of 926fa7116fd633b69277c3ad9b3370ca45163231 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:10>
Comment (by Tim Graham <timograham@…>):
In [changeset:"926fa7116fd633b69277c3ad9b3370ca45163231" 926fa71]:
{{{
#!CommitTicketReference repository=""
revision="926fa7116fd633b69277c3ad9b3370ca45163231"
Fixed #29317 -- Doc'd filter argument in contrib.postgres aggregates.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29317#comment:11>