summaryrefslogtreecommitdiff
path: root/tests/postgres_tests/test_aggregates.py
AgeCommit message (Collapse)Author
2023-02-07[4.2.x] Fixed #34285 -- Fixed index/slice lookups on filtered aggregates ↵Nils VAN ZUIJLEN
with ArrayField. Thanks Simon Charette for the review. Backport of ae1fe72e9b1f5fe3b05e5b670bd0c205cd305e71 from main
2022-12-02Improved isolation of TestGeneralAggregate.test_default_argument().Simon Charette
2022-12-01Refs #33308 -- Deprecated support for passing encoded JSON string literals ↵Simon Charette
to JSONField & co. JSON should be provided as literal Python objects an not in their encoded string literal forms.
2022-11-29Refs #10929 -- Fixed aggregates crash when passing strings as defaults.Simon Charette
Previously strings were interpreted as F() expressions and default crashed with AttributeError: 'F' object has no attribute 'empty_result_set_value'
2022-09-17Fixed #34016 -- Fixed QuerySet.values()/values_list() crash on ArrayAgg() ↵Alexander Kerkum
and JSONBAgg(). Regression in e06dc4571ea9fd5723c8029959b95808be9f8812.
2022-08-06Fixed #33898 -- Fixed Window() expression crash with ArrayAgg().Mariusz Felisiak
Thanks Kia for the report. Regression in e06dc4571ea9fd5723c8029959b95808be9f8812.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-10-01Fixed #32961 -- Added BitXor() aggregate to django.contrib.postgres.Nick Pope
2021-09-27Fixed #33114 -- Defined default output_field of StringAgg.ali
Thanks Simon Charette for the review.
2021-07-26Fixed #32906 -- Added docs and tests for using key and index lookups on ↵abhiabhi94
JSONBAgg results. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-19Refs #10929 -- Deprecated forced empty result value for PostgreSQL aggregates.Nick Pope
This deprecates forcing a return value for ArrayAgg, JSONBAgg, and StringAgg when there are no rows in the query. Now that we have a ``default`` argument for aggregates, we want to revert to returning the default of ``None`` which most aggregate functions return and leave it up to the user to decide what they want to be returned by default.
2021-07-19Fixed #10929 -- Added default argument to aggregates.Nick Pope
Thanks to Simon Charette and Adam Johnson for the reviews.
2021-06-30Fixed #32786 -- Moved subquery ordering clearing optimization to the _in lookup.Hannes Ljungberg
Co-Authored-By: Simon Charette <charette.s@gmail.com>
2021-06-29Refs #26430 -- Added tests for PostgreSQL-specific aggregates on ↵Mariusz Felisiak
EmptyQuerySets and used subTest().
2021-06-28Removed unnecessary json.loads() call in test_json_agg_empty().Nick Pope
2021-06-28Ensured that empty result test for JSONBAgg executes a query.Nick Pope
Use of QuerySet.none() will cause the EmptyQuerySet aggregation optimisation to be used. Change the test to be implemented like the other tests for empty results in this file.
2021-06-28Corrected test method and variable names for JSONBAgg.Nick Pope
This is probably a hangover from when the aggregate function was originally called JSONAgg during development.
2020-11-04Fixed #32169 -- Added distinct support to JSONBAgg.Artur Beltsov
2020-10-14Refs #32096 -- Fixed crash of ArrayAgg/StringAgg/JSONBAgg with ordering over ↵Mariusz Felisiak
JSONField key transforms. Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd. Thanks Igor Jerosimić for the report.
2020-10-14Refs #32096 -- Added test for ArrayAgg over JSONField key transforms.Mariusz Felisiak
2020-07-21Refs #31720 -- Defined default output_field of BoolAnd() and BoolOr() ↵David Chorpash
aggregate functions.
2020-06-13Fixed #31691 -- Added ordering support to JSONBAgg.John Parton
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-02-03Fixed CVE-2020-7471 -- Properly escaped StringAgg(delimiter) parameter.Simon Charette
2019-12-31Fixed #31097 -- Fixed crash of ArrayAgg and StringAgg with filter when used ↵David Wobrock
in Subquery.
2019-12-31Refs #31097 -- Added tests for filter in ArrayAgg and StringAgg.David Wobrock
2019-05-28Fixed #30315 -- Fixed crash of ArrayAgg and StringAgg with ordering when ↵Caio Ariede
used in Subquery.
2019-04-06Fixed #30332 -- Fixed crash of ordering by expressions with params in ↵Simone Pellizzari
ArrayAgg and StringAgg.
2019-04-06Refs #26067 -- Added more tests for ordering in StringAgg.Simone Pellizzari
2019-02-04Fixed #30155 -- Dropped support for PostgreSQL 9.4 and PostGIS 2.1.Tim Graham
2018-06-28Fixed #26067 -- Added ordering support to ArrayAgg and StringAgg.Floris den Hengst
2017-12-30Fixed #28908 -- Allowed ArrayField lookups on ArrayAgg annotations.Sergey Fedoseev
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-06-28Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen
2017-02-04Fixed #27767 -- Added distinct argument to ArrayAgg.orf
2016-11-28Refs #26327 -- Renamed JsonAgg to JSONBAgg.Mads Jensen
Thanks to Christian von Roques for the report.
2016-10-07Fixed #26327 -- Added JsonAgg to contrib.postgres.Mads Jensen
Thanks Tim Graham for review.
2016-06-02Fixed #26617 -- Added distinct argument to contrib.postgres's StringAgg.Rustam Kashapov
2015-05-30Name PostgreSQL correctly.Marc Tamlyn
2015-04-18Stopped special-casing postgres-specific testsClaude Paroz
Refs #23879.
2015-03-30Fixed #24301 -- Added PostgreSQL-specific aggregate functionsAndriy Sokolovskiy