Hi all, I'm trying to get a secret key using the P...
# prefect-cloud
g
Hi all, I'm trying to get a secret key using the Prefect Secret Block in the Jupyter notebook UI. When doing so, I get the error:
Copy code
AttributeError: 'coroutine' object has no attribute 'get'
Below is the code to generate this error:
Copy code
from prefect.blocks.system import Secret

secret_block = Secret.load("name-of-my-block")
secret_block.get()
I believe this is specific to working in Jupyter. Any recommendations to resolve this error? I've added a couple of related docs in this thread.
a
I suspect that Secret.load (the function) is asynchronous - meaning it doesn’t return a value (that you can .get) but instead a reference (also called a coroutine) to a thing that you could await until its ready (and then you can .get). If you
secret_block = await Secret.load('name-of-my-block')
does that work for you?
upvote 1