diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-06 13:53:42 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-17 11:49:15 +0100 |
| commit | 0be8095b254fad65b2480d677ebe6098c41bbad6 (patch) | |
| tree | 0c084fdc30cbcc0e7cb7e76955b20316da137396 /docs | |
| parent | 43b01300b7c7e9d24b549a408010e52a09726060 (diff) | |
Refs #10929 -- Stopped forcing empty result value by PostgreSQL aggregates.
Per deprecation timeline.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/postgres/aggregates.txt | 27 | ||||
| -rw-r--r-- | docs/releases/5.0.txt | 4 |
2 files changed, 16 insertions, 15 deletions
diff --git a/docs/ref/contrib/postgres/aggregates.txt b/docs/ref/contrib/postgres/aggregates.txt index 79cfa8432b..d304a75ce1 100644 --- a/docs/ref/contrib/postgres/aggregates.txt +++ b/docs/ref/contrib/postgres/aggregates.txt @@ -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 ================================== diff --git a/docs/releases/5.0.txt b/docs/releases/5.0.txt index 12478e0b89..011d01bec0 100644 --- a/docs/releases/5.0.txt +++ b/docs/releases/5.0.txt @@ -270,6 +270,10 @@ to remove usage of these features. * The ``extra_tests`` argument for ``DiscoverRunner.build_suite()`` and ``DiscoverRunner.run_tests()`` is removed. +* The ``django.contrib.postgres.aggregates.ArrayAgg``, ``JSONBAgg``, and + ``StringAgg`` aggregates no longer return ``[]``, ``[]``, and ``''``, + respectively, when there are no rows. + See :ref:`deprecated-features-4.1` for details on these changes, including how to remove usage of these features. |
