[PULL REQUEST] Update Estimates to allow for Series 16 MGRAs - #298
[PULL REQUEST] Update Estimates to allow for Series 16 MGRAs#298GregorSchroeder wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates employment crosswalk generation to source run-specific MGRA geography, including Series 16.
Changes:
- Loads MGRA geometry from the Estimates database.
- Passes run and database configuration into the GIS query.
- Replaces fixed MGRA15 spatial joins with run-specific geography.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
sql/employment/xref_block_to_mgra.sql |
Uses run-specific MGRA geometry. |
python/utils.py |
Exposes the Estimates database name. |
python/employment.py |
Supplies new SQL parameters. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
sql/employment/xref_block_to_mgra.sql:22
- The new
run_id-based lookup makes this cross-reference work with the run's MGRA series, but the file header still states that it maps only to Series 15. Update the header so future callers are not given an obsolete constraint.
DECLARE @run_id INTEGER = :run_id;
gracechung
left a comment
There was a problem hiding this comment.
I have reviewed the Series 16 special MGRAs and confirmed that the list includes all prisons and detention facilities. The assigned/tagged MGRAs (MGRA16) are correct.
Describe this pull request. What changes are being made?
This pull request prepares the employment module to use Series 16 geographies by pulling directly from the
[inputs].[mgra]table within thesql/employment/get_military_employment.sqlandsql/employment/xref_block_to_mgra.sqlSQL scripts.Special MGRAs for Series 16 are added.
Validation and testing
Ran employment module in debug mode for
[run_id] =233successfully.@SarahHudson-SANDAG visually confirmed Series 16 special MGRAs in ArcGIS Pro.
Ran a full 2020-2025 test run using Series 16 with the special MGRAs inserted into production (
[run_id]=234) and it passed allreporting/reporting.pychecks.What issues does this pull request address?
closes #296
closes #297
Additional context
The two SQL scripts were originally written to only run on the GIS server due to a double-hop issue that has since been resolved by the IT team. This was the only part of the Estimates Program besides adding special MGRAs (see #296) that would not work with Series 16 MGRAs.
@bryce-sandag - please review SQL+Python+outputs
@gracechung - please review the Series 16 special MGRAs