<@ULVA73B9P> I am upgrading to Prefect 3 from Pref...
# ask-marvin
m
@Marvin I am upgrading to Prefect 3 from Prefect 2.20. Have a look at this function which I made async and now having trouble with it:
Copy code
from prefect_aws import AwsCredentials
from prefect_aws.secrets_manager import read_secret
from src.config import PREFECT_AWS_SERVICE_USER

@flow
async def get_aws_secret(secret_name, return_string=False):
    secret_string = await read_secret(
        secret_name=secret_name
        , aws_credentials=AwsCredentials.load(PREFECT_AWS_SERVICE_USER)
        )
return secret_string
I get errors:
Copy code
python -c 'from utility import get_aws_secret; import asyncio; res = asyncio.run(get_aws_secret("/ikeloa/databricks.desa-lab.token"))
  File "/Users/merlinr/Library/Caches/pypoetry/virtualenvs/templisher-4hu7XBP5-py3.11/lib/python3.11/site-packages/prefect/cache_policies.py", line 297, in compute_key
    return hash_objects(hashed_inputs, raise_on_failure=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/merlinr/Library/Caches/pypoetry/virtualenvs/templisher-4hu7XBP5-py3.11/lib/python3.11/site-packages/prefect/utilities/hashing.py", line 89, in hash_objects
    raise HashError(msg)
prefect.exceptions.HashError: Unable to create hash - objects could not be serialized.
  JSON error: Unable to serialize unknown type: <class 'coroutine'>
  Pickle error: cannot pickle 'coroutine' object
m
Your message was too long by 510 tokens...
Your message was too long by 83 tokens...
Your message was too long by 53 tokens...