Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[US_AZ] Refactor incarceration periods view based on initial validati…
…on (Recidiviz/recidiviz-data#29313) ## Description of the change See full notes from validation process [here](https://docs.google.com/document/d/135KIzywjfdxt-3S1qEDCtWneAnOtsMclY01P30EQR80/edit). There were two main issues with the incarceration periods view that arose while I was comparing the set of people who we believed were incarcerated on 6/15 of the last 5 years with the set of people ADCRR believed were incarcerated on those same dates. 1. Recidiviz is not properly closing “periods” that were opened and closed on the same day, particularly when there are an odd number of movements tracked on that one day. 2. Recidiviz is not always correctly tracking movements that happen after an escorted leave of any kind. These escorted leaves include trips to court and the hospital. There are a number of examples of each of these situations in the notes document that I have confirmed are fixed by this change. This change also greatly simplifies the logic of the view so that further tightening of this validation will be easier. One thing that became clear after this change is that the process for revocations in AZ often goes like this: a person is out on supervision, and is involved in some sort of incident that results in a `Temporary Placement` in a facility, presumably while the incident is reviewed. After that initial placement, there can be another movement signifying that the person's supervision was revoked. For this reason, we see `Parole Revoked`-type movements as "releases" not infrequently. This initial period of `Temporary Placement` should possibly be mapped to some investigative status when it is followed by a revocation. Tests: - [x] external ID fields are unique - [x] run_mappings script passes - [x] ingest view query is deterministic (in progress!) - [x] sandbox ingest [pipeline](https://console.cloud.google.com/dataflow/jobs/us-west1/2024-04-24_11_53_36-10222558064572225174?project=recidiviz-staging) succeeds (in progress) ## 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 Related to Recidiviz/recidiviz-data#28522 Related to Recidiviz/recidiviz-data#28906 Related to Recidiviz/recidiviz-data#28907 ## Checklists ### Development **This box MUST be checked by the submitter prior to merging**: - [ ] **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 - [ ] Potential security implications or infrastructural changes have been considered, if relevant GitOrigin-RevId: 34d6eb6d828aafe6e7ed99154526baef79d34a1f
- Loading branch information
1 parent
11fa787
commit ca05752
Showing
2 changed files
with
208 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.