hey guys, if I want to check for the existence of ...
# prefect-server
k
hey guys, if I want to check for the existence of a secret, is the best way to do that through
prefect.context.get('<SECRET NAME>')
or should I use the
Secret()
class?
k
Hey @kevin, I think it would be
Secret().get()
because the first one means it’s in context already (and cloud secrets might not be there).
For local secrets on server, the context might work
k
Secret().get()
will throw a KeyError if the secret doesn't exist right? So i can manage it like a normal python exception?
or is there something I should be aware of?
k
Yes that’s exactly right I think
k
sounds good, appreciate the response 🙂
👍 1