Ensy 430 patronload preferred names project update patron load app#157
Merged
adamshire123 merged 7 commits intoOct 28, 2025
Merged
Conversation
Our data warehouse tables were updated with new fields for legal and preferred names for both staff and students. * updates BD query to pull in new legal name and preferred name fields * moves name mapping logic to populate_common_fields * updates tests and fixtures, notably using different names in staff and student fixtures * removes logic and associated tests to parse comma-separated staff names because now we are getting staff names in separate fields
libaio1 is no longer available Updated the Dockerfile to install libaio1t64 instead, which provides the same shared library needed by the Oracle Instant Client.
-removes fall back to legal name -updates tests and fixtures
- adds logic to compare legal and preferred names, only populating preferred name fields if they differ from the corresponding legal name field - updates tests
adamshire123
requested review from
ehanson8 and
ghukill
and removed request for
a team
October 24, 2025 20:24
ehanson8
approved these changes
Oct 27, 2025
ehanson8
left a comment
Contributor
There was a problem hiding this comment.
Ran in stage and observed the new fields in the file, great work!
Comment on lines
+225
to
+227
| patron_template.pref_middle_name.string = ( # type: ignore[union-attr] | ||
| patron_dict["PREFERRED_MIDDLE_NAME"] or "" | ||
| ) |
Contributor
There was a problem hiding this comment.
I assume this field rarely gets used but why does this break from the pattern of or patron_dict["LEGAL_MIDDLE_NAME"] or ""?
Contributor
There was a problem hiding this comment.
Disregard, I saw this changed in a later commit
Comment on lines
+220
to
+230
| for part in ["FIRST", "MIDDLE", "LAST"]: | ||
| pref = (patron_dict.get(f"PREFERRED_{part}_NAME") or "").strip() | ||
| legal = (patron_dict.get(f"LEGAL_{part}_NAME") or "").strip() | ||
|
|
||
| # Assign legal name | ||
| getattr(patron_template, f"{part.lower()}_name").string = legal | ||
|
|
||
| # Compare case-insensitively; assign only if different | ||
| getattr(patron_template, f"pref_{part.lower()}_name").string = ( | ||
| pref if pref.lower() != legal.lower() and pref else "" | ||
| ) |
Contributor
There was a problem hiding this comment.
Excellent way to avoid repetition!
| COPY vendor/instantclient-basiclite-linux.x64-21.9.0.0.0dbru.zip / | ||
| RUN unzip -j instantclient-basiclite-linux.x64-21.9.0.0.0dbru.zip -d /opt/lib/ | ||
| RUN apt-get install -y unzip libaio1t64 | ||
| RUN ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/libaio.so.1 |
Contributor
There was a problem hiding this comment.
Glad this updated package worked!
ghukill
approved these changes
Oct 27, 2025
Comment on lines
+220
to
+230
| for part in ["FIRST", "MIDDLE", "LAST"]: | ||
| pref = (patron_dict.get(f"PREFERRED_{part}_NAME") or "").strip() | ||
| legal = (patron_dict.get(f"LEGAL_{part}_NAME") or "").strip() | ||
|
|
||
| # Assign legal name | ||
| getattr(patron_template, f"{part.lower()}_name").string = legal | ||
|
|
||
| # Compare case-insensitively; assign only if different | ||
| getattr(patron_template, f"pref_{part.lower()}_name").string = ( | ||
| pref if pref.lower() != legal.lower() and pref else "" | ||
| ) |
adamshire123
deleted the
ENSY-430-patronload-preferred-names-project-update-patron-load-app
branch
October 28, 2025 13:16
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose and background context
We want to add preferred names to the set of columns we pull in from the data warehouse to populate alma patron records.
In the data warehouse tables the app pulls from, columns for legal and preferred first, middle, and last names were added for us.
Because we now have parallel name columns in the student and employee tables, that mapping could be moved out of the student and employee mapping functions and into to the populate_common_fields function
In the DW tables, the preferred first and last name columns are always populated. If no preferred first or last name was specified by a user, the legal name is used to populate preferred name column in the table
We didn't want to populate preferred name fields in alma unless they were different than the legal name, so logic was added to compare the legal name with the corresponding preferred name column and only populate the preferred name field(s) in the Alma xml input file when they differ.
How can a reviewer manually see the effects of these changes?
Includes new or updated dependencies?
YES, we needed to update the libaio1 library to use libaio1t64
see 8adcfc6
Changes expectations for external applications?
NO - No changes to Alma or Primo are required
What are the relevant tickets?
https://mitlibraries.atlassian.net/browse/ENSY-430
Developer
Code Reviewer(s)