merlin
01/13/2025, 5:43 AMfrom 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:
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
Marvin
01/13/2025, 5:43 AMMarvin
01/13/2025, 5:43 AMMarvin
01/13/2025, 5:44 AM