summaryrefslogtreecommitdiff
path: root/tests/aggregation_regress
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #34176 -- Fixed grouping by ambiguous aliases.Simon Charette2023-01-092-3/+133
| | | | | | | | | | | | | | | Regression in b7b28c7c189615543218e81319473888bc46d831. Refs #31377. Thanks Shai Berger for the report and reviews. test_aggregation_subquery_annotation_values_collision() has been updated as queries that are explicitly grouped by a subquery should always be grouped by it and not its outer columns even if its alias collides with referenced table columns. This was not possible to accomplish at the time 10866a10 landed because we didn't have compiler level handling of colliding aliases.
* Refs #17144 -- Removed support for grouping by primary key.Simon Charette2022-11-071-9/+5
| | | | | No core backend require the feature anymore as it was only added to support a MySQL'ism that has been deprecated since then.
* Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner2022-10-081-26/+26
| | | | | | assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
* Replaced assertQuerysetEqual() to assertSequenceEqual()/assertCountEqual() ↵Mariusz Felisiak2022-10-071-2/+2
| | | | | where appropriate. Follow up to 3f7b3275627385f8f7531fca01cdda50d4ec6b6e.
* Refs #33308 -- Enabled explicit GROUP BY and ORDER BY aliases.Simon Charette2022-10-061-4/+13
| | | | | | | This ensures explicit grouping from using values() before annotating an aggregate function groups by selected aliases if supported. The GROUP BY feature is disabled on Oracle because it doesn't support it.
* Fixed #34024 -- Fixed crash when aggregating querysets with Q objects ↵David Sanders2022-09-231-0/+3
| | | | | | | | | | | annotations. This reverts b64db05b9cedd96905d637a2d824cbbf428e40e7. It was reasonable to assume it was unnecessary code as there were no failing tests upon its removal. This commit adds the necessary regression tests for the failing condition identified in #34024 alongside the original tests added in the PR for which WhereNode.is_summary was introduced.
* Relaxed some query ordering assertions in various tests.Mariusz Felisiak2022-04-141-1/+1
| | | It accounts for differences seen on MySQL with MyISAM storage engine.
* Fixed #29865 -- Added logical XOR support for Q() and querysets.Ryan Heard2022-03-041-0/+22
|
* Refs #11293 -- Added test for filtering aggregates with negated & operator.Mariusz Felisiak2022-03-041-1/+13
|
* Removed redundant QuerySet.all() calls in docs and tests.Nick Pope2022-02-221-10/+6
| | | | Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-13/+30
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-072-730/+975
|
* Fixed #32690 -- Fixed __in lookup crash when combining with filtered aggregates.Simon Charette2021-05-051-0/+8
| | | | | | | | | | | Having lookups group by subquery right-hand-sides is likely unnecessary in the first place but relatively large amount of work would be needed to achieve that such as making Lookup instances proper resolvable expressions. Regression in 35431298226165986ad07e91f9d3aca721ff38ec. Thanks James A. Munsch for the report.
* Fixed #32168 -- Removed serial pk assumption in aggregation_regress tests.Christopher Wang2020-11-041-3/+5
|
* Refs #32168 -- Fixed Publisher assertions in AggregationTests.test_more_more.Christopher Wang2020-11-041-4/+4
| | | | | | Refer to Publisher objects instead of Books. Test regression in 1bf25e9bc6df6c2ae4c0b10fb839e101471e8373.
* Fixed #31910 -- Fixed crash of GIS aggregations over subqueries.Simon Charette2020-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Regression was introduced by fff5186 but was due a long standing issue. AggregateQuery was abusing Query.subquery: bool by stashing its compiled inner query's SQL for later use in its compiler which made select_format checks for Query.subquery wrongly assume the provide query was a subquery. This patch prevents that from happening by using a dedicated inner_query attribute which is compiled at a later time by SQLAggregateCompiler. Moving the inner query's compilation to SQLAggregateCompiler.compile had the side effect of addressing a long standing issue with aggregation subquery pushdown which prevented converters from being run. This is now fixed as the aggregation_regress adjustments demonstrate. Refs #25367. Thanks Eran Keydar for the report.
* Refs #30446 -- Removed unnecessary Value(..., output_field) in docs and tests.Simon Charette2020-07-151-2/+2
|
* Fixed #30446 -- Resolved Value.output_field for stdlib types.Simon Charette2020-07-151-1/+1
| | | | | | This required implementing a limited form of dynamic dispatch to combine expressions with numerical output. Refs #26355 should eventually provide a better interface for that.
* Removed unused __str__() methods in tests models.Mariusz Felisiak2020-04-301-15/+0
| | | Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
* Simplified imports from django.db and django.contrib.gis.db.Nick Pope2020-02-041-3/+2
|
* Refs #14357 -- Made Meta.ordering not affect GROUP BY queries.Mariusz Felisiak2019-09-101-13/+2
| | | | Per deprecation timeline.
* Fixed #28107 -- Added ↵Vojtech Bocek2019-09-091-0/+27
| | | | DatabaseFeatures.allows_group_by_selected_pks_on_model() to allow enabling optimization for unmanaged models.
* Fixed typos in test names and a comment.Min ho Kim2019-08-231-1/+1
|
* Corrected several typos in string literals and test names.Min ho Kim2019-08-071-1/+1
|
* Refs #28643 -- Changed Variance() to use NumericOutputFieldMixin.Nick Pope2019-01-141-2/+2
| | | | Keeps precision instead of forcing DecimalField to FloatField.
* Refs #28643 -- Changed StdDev() to use NumericOutputFieldMixin.Nick Pope2019-01-141-2/+2
| | | | Keeps precision instead of forcing DecimalField to FloatField.
* Refs #28643 -- Changed Avg() to use NumericOutputFieldMixin.Nick Pope2019-01-141-2/+2
| | | | Keeps precision instead of forcing DecimalField to FloatField.
* Fixed #28658 -- Added DISTINCT handling to the Aggregate class.Simon Charette2019-01-091-0/+11
|
* Fixed #30056 -- Added SQLite support for StdDev and Variance functions.Nick Pope2018-12-241-1/+0
|
* Refs #14357 -- Deprecated Meta.ordering affecting GROUP BY queries.Ramiro Morales2018-09-131-9/+22
| | | Thanks Ramiro Morales for contributing to the patch.
* Fixed #29320 -- Added an exception when an annotation alias matches a ↵Flávio Juvenal2018-04-121-0/+5
| | | | ForeignKey attname.
* Fixed #29067 -- Fixed regression in QuerySet.values_list(..., flat=True) ↵Jon Dufresne2018-01-261-0/+5
| | | | followed by annotate().
* Used assertRaisesMessage() to test Django's error messages.Mads Jensen2017-07-291-8/+26
|
* Fixed #28107 -- Disabled grouping of selected primary keys for unmanaged models.Simon Charette2017-05-111-0/+37
| | | | | | | | | The grouping caused an issue with database views as PostgreSQL's query planer isn't smart enough to introspect primary keys through views. Django doesn't support database views but documents that unmanaged models should be used to query them. Thanks powderflask for the detailed report and investigation.
* Refs #23919 -- Removed most of remaining six usageClaude Paroz2017-01-181-2/+1
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz2017-01-181-6/+0
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-182-3/+0
|
* Fixed #25307 -- Fixed QuerySet.annotate() crash with conditional expressions.Josh Smeaton2017-01-161-1/+47
| | | | Thanks Travis Newport for the tests and Josh Smeaton for contributing to the patch.
* Fixed #27632 -- Unified query parameters by their values on Oracle.Mariusz Felisiak2016-12-281-0/+13
|
* Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za2016-11-101-19/+11
|
* Fixed typo in tests/aggregation_regress/tests.py.Tim Graham2016-09-241-1/+1
|
* Fixed #27203 -- Replaced assertQuerysetEqual(..., lambda o: o) with ↵Mads Jensen2016-09-131-30/+15
| | | | assertSequenceEqual().
* Fixed E128 flake8 warnings in tests/.Tim Graham2016-04-081-8/+16
|
* Fixed W503 flake8 warnings.Tim Graham2016-04-041-2/+2
|
* Sorted single letter imports per the latest version of isort.Tim Graham2016-03-281-1/+1
|
* Fixed #26176 -- Fixed E123 flake8 warnings.26176Tim Graham2016-02-051-1/+1
|
* Refs #26022 -- Used context manager version of assertRaises in tests.Hasan2016-01-291-24/+16
|
* Fixed many spelling mistakes in code, comments, and docs.Josh Soref2015-12-031-2/+2
|
* Fixed #23395 -- Limited line lengths to 119 characters.Dražen Odobašić2015-09-121-30/+152
|
* Fixed #25382 -- Removed obsolete references to DateQuerySet.Renato Oliveira2015-09-111-1/+1
|