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

Use regex pattern to get library name from fy_code #1476

Merged
merged 4 commits into from
Dec 9, 2024
Merged

Conversation

jgreben
Copy link
Contributor

@jgreben jgreben commented Dec 9, 2024

Fixes #1469

The email function was getting the FY_CODE (e.g. 'SUL2025') not a library string (e.g. 'sul'). This PR separates out a to_email function and implements a regex case matching class to handle matching on the FY_CODE.

Nb. Omitting Dags from Coveralls coverage, since we do not test the dags. Otherwise with this ended up being below the threshold for blacking the PR. https://github.com/sul-dlss/libsys-airflow/blob/40b1dc6ba72487d127736c8509d495ee6ad2ef01/.coveragerc

return f"Fix Encumbrances for {fy_code}"


class Regex_equals(str):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool! Very useful approach for using regex in the match statement.

@jgreben jgreben merged commit e7f202d into main Dec 9, 2024
4 checks passed
@jgreben jgreben deleted the 1469-fix-enc-emails branch December 9, 2024 21:42
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.

Update emails for Fix Encumbrance script DAGs
3 participants