feat(spp_metric_service): breakdown expansion + SQL column support (re-land from #76)#279
feat(spp_metric_service): breakdown expansion + SQL column support (re-land from #76)#279gonzalesedwin1123 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces demographic breakdown expansion and SQL column compilation support for metric disaggregation. Key changes include updating model names, refining the age group dimension to align with UNICEF/WHO buckets, automatically expanding groups to members for individual-level dimensions, and adding a to_sql_column method to compile dimensions into SQL expressions. The reviewer feedback focuses on performance and code quality optimizations, such as using recordset subtraction instead of lambda filtering, batch-fetching membership IDs to prevent N+1 queries, checking _fields on Odoo recordsets instead of using hasattr, guarding against falsy values early, and removing redundant SQL parameter wrapping.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
- recordset subtraction instead of lambda filter for individuals - batch individual ids from memberships (avoids N+1) - check _fields membership instead of hasattr on recordsets - early return for falsy raw_value before code search
|
gemini-code-assist disposition: Applied (commit 778e037): recordset subtraction for individuals, batched Deferred: the two |
|
Thank you for the detailed disposition. The changes you've implemented, particularly the shift to |
|
Update: the two deferred SQL("%s", default) simplifications are applied (direct parameter passing). Suite 161/0 on the integration state. All gemini findings on this PR are now addressed. |
Re-lands the spp_metric_service portion of reverted PR #76 (revert: #271). Wave 2 — stacked on #275 (spp_cel_domain); merge that first. The base is set to
reland/cel-domainso this diff shows only spp_metric_service; GitHub retargets to 19.0 when #275 merges — wait for CI to re-run green on the retargeted base before merging.Summary
Added on top of #76 (not in the original)
memberships.individual.ids(avoids N+1);_fieldsmembership check instead ofhasattron recordsets; early return for falsyraw_valuebefore code search;defaultpassed directly as a SQL parameter (two sites).Verification
./spp t spp_metric_serviceon an integration state with feat(spp_cel_domain): SQL CASE compiler, read-only smart-op lookup, translator cache tests (re-land from #76) #275 merged: 161 passed, 0 failed