Refs #10929 -- Stopped forcing empty result value by PostgreSQL aggregates.

Per deprecation timeline.
This commit is contained in:
Mariusz Felisiak 2023-01-06 13:53:42 +01:00
parent 43b01300b7
commit 0be8095b25
4 changed files with 34 additions and 142 deletions

View file

@ -52,12 +52,11 @@ General-purpose aggregation functions
from django.db.models import F
F('some_field').desc()
.. deprecated:: 4.0
.. versionchanged:: 5.0
If there are no rows and ``default`` is not provided, ``ArrayAgg``
returns an empty list instead of ``None``. This behavior is deprecated
and will be removed in Django 5.0. If you need it, explicitly set
``default`` to ``Value([])``.
In older versions, if there are no rows and ``default`` is not
provided, ``ArrayAgg`` returned an empty list instead of ``None``. If
you need it, explicitly set ``default`` to ``Value([])``.
``BitAnd``
----------
@ -173,12 +172,11 @@ General-purpose aggregation functions
{'parking': True, 'double_bed': True}
]}]>
.. deprecated:: 4.0
.. versionchanged:: 5.0
If there are no rows and ``default`` is not provided, ``JSONBAgg``
returns an empty list instead of ``None``. This behavior is deprecated
and will be removed in Django 5.0. If you need it, explicitly set
``default`` to ``Value('[]')``.
In older versions, if there are no rows and ``default`` is not
provided, ``JSONBAgg`` returned an empty list instead of ``None``. If
you need it, explicitly set ``default`` to ``Value([])``.
``StringAgg``
-------------
@ -232,12 +230,11 @@ General-purpose aggregation functions
'headline': 'NASA uses Python', 'publication_names': 'Science News, The Python Journal'
}]>
.. deprecated:: 4.0
.. versionchanged:: 5.0
If there are no rows and ``default`` is not provided, ``StringAgg``
returns an empty string instead of ``None``. This behavior is
deprecated and will be removed in Django 5.0. If you need it,
explicitly set ``default`` to ``Value('')``.
In older versions, if there are no rows and ``default`` is not
provided, ``StringAgg`` returned an empty string instead of ``None``.
If you need it, explicitly set ``default`` to ``Value("")``.
Aggregate functions for statistics
==================================