One question I have is how best to use decorated functions in Jupyter notebook environments? For example the following code works in a plain Python script
from prefect.blocks.system import Secret
secret_block = Secret.load("my-secret")
secret_block # This is a Secret block
However, if I run it in Jupyter, secret_block is a coroutine, presumably because the sync_compatible decorator detects the async event loop running in the Jupyter notebook. So I have to remember to do await secret_block = Secret.load("my-secret") when I am in a notebook.
Is there a way to get the code to work the same regardless of whether it is running in Jupyter or as a script?