fix: convert gps_location from Python extractor to SQL path extraction#28
fix: convert gps_location from Python extractor to SQL path extraction#28akkaouim merged 2 commits intojjackson:labs-mainfrom
Conversation
The extract_gps_location() extractor forced the SQL query to load form_json for all ~48k visits into Python memory (~480MB), causing the Fargate container to OOM-crash during process_and_cache(). Replace with COALESCE path-based extraction: - form.meta.location.#text (dict with #text key) - form.meta.location (string fallback) This runs entirely in PostgreSQL — zero Python memory for form_json. All 13 pipeline fields are now path-based; no extractors remain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughConsolidates GPS extraction in the MBW monitoring pipeline by removing the Python extractor and switching Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@commcare_connect/workflow/templates/mbw_monitoring/DOCUMENTATION.md`:
- Line 558: Update the documentation so every occurrence of the gps_location
extractor is documented as a paths-based field (not extractor-based); find all
sections that currently describe gps_location as "extractor-based" and change
them to match the table row showing gps_location → paths with paths
`form.meta.location.#text`, `form.meta.location` and the COALESCE behavior (dict
`#text` key or string fallback); ensure any examples, headings, and migration
notes that mention gps_location/original extractor usage are rewritten to show
the paths-based extractor and consistent wording about COALESCE and path
resolution.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
commcare_connect/workflow/templates/mbw_monitoring/DOCUMENTATION.mdcommcare_connect/workflow/templates/mbw_monitoring/pipeline_config.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The extract_gps_location() extractor forced the SQL query to load form_json for all ~48k visits into Python memory (~480MB), causing the Fargate container to OOM-crash during process_and_cache().
Replace with COALESCE path-based extraction:
This runs entirely in PostgreSQL — zero Python memory for form_json. All 13 pipeline fields are now path-based; no extractors remain.
Summary by CodeRabbit
Bug Fixes
Documentation