| Age | Commit message (Collapse) | Author |
|
and random order_by strings.
Run this example:
```python
User.objects.values("is_staff").annotate(latest=Max("date_joined")).order_by("-latest").count()
```
You should see the following exception:
```
django.core.exceptions.FieldError: Cannot resolve keyword '-latest' into field.
```
Regression in 2ce5cb0f7a4618dfdc5f5c10e53e2e9b9543d298.
|
|
|
|
|
|
explicit grouping.
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
missing from explicit grouping."
This reverts commit ea3a71c2d09f8281d8a50ed20e40e1fb13db5cd9.
The implementation was flawed, as self.group_by contains Cols, not aliases.
|
|
explicit grouping.
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
https://github.com/psf/black/releases/tag/24.1.0
|
|
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.
|
|
No core backend require the feature anymore as it was only added to
support a MySQL'ism that has been deprecated since then.
|
|
assertQuerySetEqual().
Co-Authored-By: Michael Howitz <mh@gocept.com>
|
|
where appropriate.
Follow up to 3f7b3275627385f8f7531fca01cdda50d4ec6b6e.
|
|
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.
|
|
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.
|
|
It accounts for differences seen on MySQL with MyISAM storage engine.
|
|
|
|
|
|
Most QuerySet methods are mapped onto the Manager and, in general,
it isn't necessary to call .all() on the manager.
|
|
|
|
|
|
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.
|
|
|
|
Refer to Publisher objects instead of Books.
Test regression in 1bf25e9bc6df6c2ae4c0b10fb839e101471e8373.
|
|
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.
|
|
|
|
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.
|
|
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
|
|
|
|
Per deprecation timeline.
|
|
DatabaseFeatures.allows_group_by_selected_pks_on_model() to allow enabling optimization for unmanaged models.
|
|
|
|
|
|
Keeps precision instead of forcing DecimalField to FloatField.
|
|
Keeps precision instead of forcing DecimalField to FloatField.
|
|
Keeps precision instead of forcing DecimalField to FloatField.
|
|
|
|
|
|
Thanks Ramiro Morales for contributing to the patch.
|
|
ForeignKey attname.
|
|
followed by annotate().
|
|
|
|
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.
|
|
Thanks Tim Graham for the review.
|
|
|
|
|
|
Thanks Travis Newport for the tests and Josh Smeaton for contributing
to the patch.
|
|
|
|
|
|
|
|
assertSequenceEqual().
|