Skip to content

Commit

Permalink
[Workflows][US_ME] Update sccp eligibility (Recidiviz/recidiviz-data#…
Browse files Browse the repository at this point in the history
…17058)

## Description of the change

Updates the SCCP resident eligibility field to pull from the opportunity
view instead of hard coding residents to be eligible now that the
opportunity view is deployed. There are 303 people eligible.

This has been run in the jovergaag_17057_* sandbox.

## Type of change

> All pull requests must have at least one of the following labels
applied (otherwise the PR will fail):

| Label | Description |
|-----------------------------
|-----------------------------------------------------------------------------------------------------------
|
| Type: Bug | non-breaking change that fixes an issue |
| Type: Feature | non-breaking change that adds functionality |
| Type: Breaking Change | fix or feature that would cause existing
functionality to not work as expected |
| Type: Non-breaking refactor | change addresses some tech debt item or
prepares for a later change, but does not change functionality |
| Type: Configuration Change | adjusts configuration to achieve some end
related to functionality, development, performance, or security |
| Type: Dependency Upgrade | upgrades a project dependency - these
changes are not included in release notes |

## Related issues

Closes #XXXX

## Checklists

### Development

**This box MUST be checked by the submitter prior to merging**:
- [x] **Double- and triple-checked that there is no Personally
Identifiable Information (PII) being mistakenly added in this pull
request**

These boxes should be checked by the submitter prior to merging:
- [ ] Tests have been written to cover the code changed/added as part of
this pull request

### Code review

These boxes should be checked by reviewers prior to merging:

- [ ] This pull request has a descriptive title and information useful
to a reviewer
- [ ] This pull request has been moved out of a Draft state, has no
"Work In Progress" label, and has assigned reviewers
- [ ] Potential security implications or infrastructural changes have
been considered, if relevant

GitOrigin-RevId: 63a4d18caee987e081c2c0018558e421835a1278
  • Loading branch information
jovergaag authored and Helper Bot committed Dec 20, 2022
1 parent b607285 commit 4c6c26a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
description=RESIDENT_RECORD_DESCRIPTION,
sessions_dataset=dataset_config.SESSIONS_DATASET,
dataflow_dataset=dataset_config.DATAFLOW_METRICS_MATERIALIZED_DATASET,
workflows_dataset=dataset_config.WORKFLOWS_VIEWS_DATASET,
normalized_state_dataset=dataset_config.NORMALIZED_STATE_DATASET,
us_me_raw_data_up_to_date_dataset=raw_latest_views_dataset_for_region(
state_code=StateCode.US_ME, instance=DirectIngestInstance.PRIMARY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,18 @@
USING(person_external_id)
),
me_sccp_eligibility AS (
SELECT
external_id AS person_external_id,
["usMeSCCP"] AS eligible_opportunities,
FROM `{{project_id}}.{{workflows_dataset}}.us_me_complete_transfer_to_sccp_form_record_materialized`
),
me_residents AS (
SELECT
#* EXCEPT(eligible_opportunities),
# {array_concat_with_null(["me_sccp_eligibility.eligible_opportunities"])} AS all_eligible_opportunities,
*,
["usMeSCCP"] as all_eligible_opportunities
* EXCEPT(eligible_opportunities),
{array_concat_with_null(["me_sccp_eligibility.eligible_opportunities"])} AS all_eligible_opportunities,
FROM resident_info
LEFT JOIN me_sccp_eligibility USING(person_external_id)
WHERE officer_id IS NOT NULL
)
"""

0 comments on commit 4c6c26a

Please sign in to comment.