summaryrefslogtreecommitdiff
path: root/tests/aggregation
AgeCommit message (Collapse)Author
2019-12-23[3.0.x] Fixed #31109 -- Disabled grouping by aliases on QuerySet.exists().Simon Charette
Clearing the SELECT clause in Query.has_results was orphaning GROUP BY references to it. Thanks Thierry Bastian for the report and Baptiste Mispelon for the bisect. Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80. Backport of 720de4d0441fcfdb543051389c70efbe66ed962a from master
2019-12-19[3.0.x] Fixed #31094 -- Included columns referenced by subqueries in GROUP ↵Simon Charette
BY on aggregations. Thanks Johannes Hoppe for the report. Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Backport of 5a4d7285bd10bd40d9f7e574a7c421eb21094858 from master
2019-07-31Fixed #30665 -- Added support for distinct argument to Avg() and Sum().Étienne Beaulé
2019-07-31Moved test for distinct Count() to a separate test case.Étienne Beaulé
2019-06-10Fixed #30548 -- Improved exception when expression contains mixed types.CruxBox
2019-06-05Fixed #30542 -- Fixed crash of numerical aggregations with filter.Étienne Beaulé
Filters in annotations crashed when used with numerical-type aggregations (i.e. Avg, StdDev, and Variance). This was caused as the source expressions no not necessarily have an output_field (such as the filter field), which lead to an AttributeError: 'WhereNode' object has no attribute output_field. Thanks to Chuan-Zheng Lee for the report. Regression in c690afb873cac8035a3cb3be7c597a5ff0e4b261 and two following commits.
2019-05-08Refs #30462 -- Added test for conditional aggregation on annotated subquery.Mariusz Felisiak
2019-03-23Fixed #30246 -- Reused annotation aliases references in aggregation filters.Simon Charette
Thanks Jan Baryła for the detailed report and the reduced test case.
2019-03-21Fixed #30158 -- Avoided unnecessary subquery group by on aggregation.Simon Charette
Subquery annotations can be omitted from the GROUP BY clause on aggregation as long as they are not explicitly grouped against. Thanks Jonny Fuller for the report.
2019-01-21Fixed #30120 -- Fixed invalid SQL in distinct aggregate.Simon Charette
Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111 (refs #28658).
2019-01-14Refs #28643 -- Changed Avg() to use NumericOutputFieldMixin.Nick Pope
Keeps precision instead of forcing DecimalField to FloatField.
2019-01-09Fixed #28658 -- Added DISTINCT handling to the Aggregate class.Simon Charette
2018-12-06Fixed #30011 -- Fixed queries that reuse filtered aggregates.Simon Charette
Thanks Taqi Abbas and Raphael Kimmig for the report.
2018-08-23Fixed #29048 -- Added **extra_context to database function as_vendor() methods.priyanshsaxena
2018-02-02Simplified aggregation.tests. Mariusz Felisiak
2017-08-12Fixed #27849 -- Added filtering support to aggregates.Tom
2017-07-21Refs #24887 -- Stopped mutating a test expression during as_sql().Simon Charette
Also defined an explicit output_field as it was mixing an expression with an IntegerField() with one with a DecimalField().
2017-07-11Fixed #28382 -- Prevented BaseExpression._output_field from being set if ↵Sergey Fedoseev
_resolve_output_field() fails.
2017-06-29Fixed #28277 -- Added validation of QuerySet.annotate() and aggregate() args.Mariusz Felisiak
Thanks Tim Graham and Nick Pope for reviews.
2017-06-01Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.Jon Dufresne
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2017-01-14Fixed tests that rely on hardcoded id with keepdbJosh Smeaton
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-04-05Fixed #26458 -- Based Avg's default output_field resolution on its source ↵Simon Charette
field type. Thanks Tim for the review and Josh for the input.
2016-03-28Sorted single letter imports per the latest version of isort.Tim Graham
2016-01-29Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as ↵Hasan
appropriate.
2015-12-03Fixed many spelling mistakes in code, comments, and docs.Josh Soref
2015-09-23Refs #14030 -- Removed backwards compatiblity for old-style aggregates.Tim Graham
Per deprecation timeline.
2015-09-14Fixed #25377 -- Changed Count queries to execute COUNT(*) instead of COUNT('*').Adam Chainz
2015-09-12Fixed #23395 -- Limited line lengths to 119 characters.Dražen Odobašić
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-07-27Fixed #25095 -- Fixed annotate() + values() group by bugMitchell Kotler
Thanks Josh Smeaton for help on the tests.
2015-07-13Fixed #24923 -- errored out nicely when using aggregates in order_by()Anssi Kääriäinen
2015-06-27Fixed #24887 -- Removed one-arg limit from models.aggregateGreg Chapple
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-05-30Fixed #24699 -- Added aggregate support for DurationField on OracleJosh Smeaton
2015-04-25Fixed #24649 -- Allowed using Avg aggregate on non-numeric field types.Tim Graham
2015-04-14Refs #24385 -- Added tests for distinct sum issue fixed in ↵Edward Henderson
c7fd9b242d2d63406f1de6cc3204e35aaa025233
2015-03-05Converted test fixtures to setUpTestData methodsJosh Smeaton
2015-02-13Refs #14030 -- Added tests for Value aggregatesJosh Smeaton
2015-02-12Refs #14030 -- Improved expression support for python valuesJosh Smeaton
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-22Fixed small inconsistency when handling aggregate's default_alias.Loic Bistuer
Refs #14030.
2015-01-08Fixed #24020 -- Refactored SQL compiler to use expressionsAnssi Kääriäinen
Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
2014-12-30Applied ignore_warnings to Django testsClaude Paroz
2014-12-12Fixed #23941 -- Removed implicit decimal formatting from expressions.Josh Smeaton
2014-11-16Renamed qn to compilerJosh Smeaton
2014-11-16Removed references to the deprecated assertRaisesRegexp method.Simon Charette