Skip to content

Conversation

@WaVEV
Copy link
Collaborator

@WaVEV WaVEV commented Dec 9, 2025

This refactor cleans up the aggregation logic for clarity, maintainability, and better alignment with Django 6.

It replaces ad-hoc node copying and manual expression rewiring with explicit Case/When/WhereNode constructs and a new Remove expression for skipping rows.
distinct and filter handling are unified, nullable values logic is simplified, and MQL generation is more consistent.

This makes the aggregation code reduces duplication and prepares the backend for Django 6 updates.

@WaVEV WaVEV force-pushed the refactor-aggregation-methods branch from 8608039 to 5bcf02f Compare December 9, 2025 15:33
@WaVEV WaVEV marked this pull request as ready for review December 9, 2025 16:09
@WaVEV WaVEV requested review from Jibola and timgraham December 9, 2025 16:09
@timgraham
Copy link
Collaborator

The MQL has changed slightly (e.g. $$REMOVE was not present before), correct? Maybe it's best to limit this to the 6.0 and not include it in 5.2, just in case of any regressions. If we put in in the 6.0 release only, I think a release note isn't needed.

Clean up logic for better alignment with changes in Django 6.0.
@timgraham timgraham force-pushed the refactor-aggregation-methods branch from 5bcf02f to 4761579 Compare December 9, 2025 22:39
@timgraham timgraham changed the title Refactor aggregation methods Refactor Aggregation and Count implementations Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants