Skip to content

[PULL REQUEST] Update Estimates to allow for Series 16 MGRAs - #298

Open
GregorSchroeder wants to merge 6 commits into
mainfrom
297-feature-sr16-employment-module
Open

[PULL REQUEST] Update Estimates to allow for Series 16 MGRAs#298
GregorSchroeder wants to merge 6 commits into
mainfrom
297-feature-sr16-employment-module

Conversation

@GregorSchroeder

@GregorSchroeder GregorSchroeder commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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 the sql/employment/get_military_employment.sql and sql/employment/xref_block_to_mgra.sql SQL scripts.

  • Special MGRAs for Series 16 are added.

Validation and testing

Ran employment module in debug mode for [run_id] =233 successfully.
@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 all reporting/reporting.py checks.

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

@GregorSchroeder
GregorSchroeder requested a balanced review from Copilot August 26, 2026 20:12
@GregorSchroeder GregorSchroeder linked an issue Aug 26, 2026 that may be closed by this pull request
@GregorSchroeder GregorSchroeder self-assigned this Aug 26, 2026
@GregorSchroeder GregorSchroeder added the enhancement New feature or request label Aug 26, 2026
@GregorSchroeder
GregorSchroeder marked this pull request as ready for review August 26, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread python/employment.py
@GregorSchroeder GregorSchroeder changed the title [PULL REQUEST] Update employment module to allow for Series 16 MGRAs [PULL REQUEST] Update Estimates to allow for Series 16 MGRAs Aug 26, 2026
@GregorSchroeder
GregorSchroeder requested a balanced review from Copilot August 26, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread python/parsers.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 gracechung left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Update Employment Module to allow Series 16 MGRAs [FEATURE] Add Series 16 Special MGRAs

4 participants