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

Log errors but do not raise SystemExit for encumbrances script #1426

Merged
merged 7 commits into from
Nov 12, 2024

Conversation

jgreben
Copy link
Contributor

@jgreben jgreben commented Nov 11, 2024

The fix_encumbrances dag will not email the log if there is an error that raises SystemExit(1). Log the errors and always complete the script.

@jgreben
Copy link
Contributor Author

jgreben commented Nov 12, 2024

I modified the fix_encumbrances script to print the "info" and "warning" statements to stdout (the log file) and the "errors" to both stdout and the logger.

Copy link
Contributor

@shelleydoljack shelleydoljack left a comment

Choose a reason for hiding this comment

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

Do you want to address the non-zero amounts thing here or in a different PR? I'm okay either way.

@@ -723,9 +750,9 @@ async def unrelease_encumbrances_with_non_zero_amounts(
async def unrelease_open_orders_encumbrances_with_nonzero_amounts(
fiscal_year_id, open_orders_ids
):
logger.info('Unreleasing open orders encumbrances with non-zero amounts...')
print('Unreleasing open orders encumbrances with non-zero amounts...')
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the one where we updated it to fix it even if it has zero amounts? I think we should fixup the warning message too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that was

# if enc['encumbrance']['sourcePoLineId'] == poline_id and float(enc['amount']) != 0.0 and \
?

@jgreben jgreben merged commit 290f9a4 into main Nov 12, 2024
4 checks passed
@jgreben jgreben deleted the fix-enc-email-fail branch November 12, 2024 18:26
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.

3 participants