Samuel Kohlleffel
12/07/2022, 6:29 PMPeyton Runyan
12/08/2022, 10:54 AMScriptError
messages so that you get a more useful error message.
Just reproduced this. You get a KeyError
.
It runs just fine if the environment variable is presentKeyError
when it's not present, you need to use os.getenv(<MY_VAR>)
which functions the same ways a dict.get()
. This applies to all of python, not just prefect.Samuel Kohlleffel
12/08/2022, 12:42 PMDeployment.build_from_flow()
throws a Python exception when any error occurs. Right now, we just get a log message showing the generic error, but the script continues to run as if no error occurred.Peyton Runyan
12/13/2022, 10:54 PMSamuel Kohlleffel
12/14/2022, 1:48 PMDeployment.build_from_flow
.
13:46:24.407 | ERROR | root - Script at '/workspaces/nimbus/orchestration/flows/hvr_alerting/hvr_alerting.py' encountered an exception
For context, we deploy our flows during a CI job (GitHub Actions). Because the script that builds the flow deployments and pushes them to Prefect Cloud doesn't throw an error, we could in theory have a failed deployment, but our GH Action won't fail and we won't know about it. Prefect won't update/create that deployment with the error, which is an issue - especially if we don't know about it.Peyton Runyan
12/14/2022, 2:01 PMSamuel Kohlleffel
12/14/2022, 2:29 PMload_flow_from_script
incorrectly. Sorry to waste your time. I really appreciate the help though. I would've never found the issue had you not requested a working example.Peyton Runyan
12/14/2022, 2:29 PM