dhume
02/10/2020, 6:59 PMValueError: Local Secret "SLACK_WEBHOOK_URL" was not found.
I tried the suggestions mentioned here https://github.com/PrefectHQ/prefect/blob/b4c08b15b386107e2c1afb7fed35dca15b683cdd/src/prefect/client/secrets.py but wasn’t getting anything to work locally. Threading what I currently haveimport os
from prefect import Flow, task
from prefect.utilities.notifications import slack_notifier
os.environ["PREFECT__CONTEXT__SECRETS__SLACK_WEBHOOK_URL"] = "XXX"
handler = slack_notifier()
@task(state_handlers=[handler])
def add(x, y):
return x + y
with Flow("Testing") as flow:
add(7,8)
flow.run()
josh
02/10/2020, 7:04 PMexport PREFECT__CONTEXT__SECRETS__SLACK_WEBHOOK_URL="..."
or it could be placed in your ~/.prefect/config.toml
under
[context.secrets]
SLACK_WEBHOOK_URL="..."
Chris White
02/10/2020, 7:07 PMdhume
02/10/2020, 7:09 PMprefect.context.setdefault("secrets", {})
prefect.context.secrets["SLACK_WEBHOOK_URL"] = "XXX"
And it didn’t work but it did now. So I’ll take it and runChris White
02/11/2020, 4:24 PMMarvin
02/11/2020, 4:24 PM