You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Django 5.1.1 a change was made that consistently includes the filter arg of an expression in any case, even if it is empty - so if no filter is used, an additional None will be include in the list returned by get_source_expressions(). See here:
(This is also a quick workaround: If you run into this issue, transforming all aggregate expressions passed into aggregate() / annotate() into keyword args solves the problem).
Should I submit a quick PR to do that? Or is supporting Django 5 a broader issue?
The text was updated successfully, but these errors were encountered:
After updating to Django 5.1.1, I ran into errors using Aggregations:
The line that breaks is:
django-polymorphic/polymorphic/query.py
Line 279 in cfd49b2
In Django 5.1.1 a change was made that consistently includes the filter arg of an expression in any case, even if it is empty - so if no filter is used, an additional
None
will be include in the list returned byget_source_expressions()
. See here:django/django@42b567a#diff-c7d87b6e6b973bf87e5685442a6c1da9531c24bcaa86fe158c40ea0276986f32R53
It seems like we need an additional
None
check here, just like we have inpatch_lookup
:django-polymorphic/polymorphic/query.py
Line 255 in cfd49b2
(This is also a quick workaround: If you run into this issue, transforming all aggregate expressions passed into
aggregate()
/annotate()
into keyword args solves the problem).Should I submit a quick PR to do that? Or is supporting Django 5 a broader issue?
The text was updated successfully, but these errors were encountered: