Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate non-standard partner profile agency types #4261

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

veezus
Copy link
Contributor

@veezus veezus commented Apr 8, 2024

Related to #4241. Unblocks #4254

Description

Migrates all non-standard Partners::Profile agency_types to Partner::AGENCY_TYPE['OTHER'] and preserves the non-standard value in the other_agency_type column.

This will allow a straightforward migration when converting that column to an enum.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Locally, with non-standard agency_types. See screenshot.

Screenshots

non-standard agency types migration

@veezus veezus marked this pull request as ready for review April 8, 2024 17:08
@veezus
Copy link
Contributor Author

veezus commented Apr 8, 2024

@dorner This PR is a data-migration precursor to #4254.

@cielf
Copy link
Collaborator

cielf commented Apr 9, 2024

@dorner I'm looking at the prod data, there are a lot of cases where it is blindingly obvious to a human what the category is even though it isn't a 100% matchup to what the text in AGENCY_TYPES is (we did add some to AGENCY_TYPES this year). [For instance, "Community health program", of which we have at least 40, would come under "HEALTH", "Food pantry" would come under "FOOD", etc.

So there would be side effects here in the annual report section on the partners -- especially as we just lump all the "Others" together at this point.

Over the course of a year, as people recertify their partners (if they do), this might become less of an issue.

IMO, If we are doing this migration, we should change the partner_agency_counts in the PartnerInfoReportService to also split out the other. We could also provide some additional mapping of the agency types as in the db to the codes (which I would have to provide).

What do you think?

@veezus
Copy link
Contributor Author

veezus commented Apr 9, 2024

There's the option of manually updating the close ones ahead of the big move to Other in this migration. Like, based on the list it'd be easy to, for examples,

UPDATE partner_profiles SET agency_type = 'Food bank/pantry' WHERE agency_type = 'Food bank';
UPDATE partner_profiles SET agency_type = 'Food bank/pantry' WHERE agency_type = 'Food pantry';

and just reference as many items as we can. But that's all outside of my frame of reference and the collection of "non profit" ones would seem problematic.

@dorner
Copy link
Collaborator

dorner commented Apr 9, 2024

@cielf I think it would be up to you to provide the mapping, and then we can incorporate that into the migration.

@cielf
Copy link
Collaborator

cielf commented Apr 10, 2024

Nods Oh, I knew I was letting myself in for more work when I said that g. Adding it to the list for this week.

@veezus
Copy link
Contributor Author

veezus commented Apr 29, 2024

Putting this back on your radar, @cielf

@cielf
Copy link
Collaborator

cielf commented Apr 29, 2024

Yup -- I've got a proposed mapping, and I'm checking with the NDBN folks to see if I can get a review of it before passing it on to you.

@cielf
Copy link
Collaborator

cielf commented May 2, 2024

The appropriate person just got back from vacation yesterday, and this is understandably not their # 1 priority. I think we should have the review by sometime next week though.

@veezus
Copy link
Contributor Author

veezus commented May 2, 2024

Awesome, looking forward to it!

@cielf
Copy link
Collaborator

cielf commented May 11, 2024

I just got something back from NDBN this afternoon. I've got a few other things I have to pay attention to before the Sunday meeting, so it'll probably Monday for me to review and see if there's any knock on effects (It sounded like they might want to add a couple more categories)

@cielf
Copy link
Collaborator

cielf commented May 17, 2024

Ok. What I've got back from NDBN -- they are suggesting, given the full list of what we have, that we add 3 more categories:
BNB -- Basic Needs Bank,
MHEALTH -- Mental Health, and
DISTRICT -- School District.

I'll be uploading the mapping within the hour.

@cielf
Copy link
Collaborator

cielf commented May 17, 2024

Here's a CSV file. The intended use of this is that if you have the "Entry" in "Other" now, it should be the Agency Type indicated in PArtner Agency Type Short. There are definitely some that are not in this list -- so if you have an entry in "Other" that is not in this list, or that is indicated as "Other" keep it as other, and keep the other text as originally entered. Hope that makes sense!

Mapping for agency type.csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants