Michelle Brochmann
05/09/2022, 10:42 PM.fn
returns a coroutine?
I tried this:
from prefect_aws.s3 import s3_upload
...
with prefect_test_harness():
my_upload = s3_upload.fn(bucket=S3_BUCKET_NAME, key='B5_key', data=b'55555', aws_credentials = AwsCredentials())
asyncio.run(my_upload)
But it’s not working with this runtime error:
E RuntimeError: There is no active flow or task run context.
../valo-prefect-poc/.venv/lib/python3.7/site-packages/prefect/logging/loggers.py:91: RuntimeError
@flow
- mostly just curious. 😛Kevin Kho
05/09/2022, 10:59 PMZanie
05/09/2022, 11:29 PMTraceback (most recent call last):
File "/Users/mz/flow.py", line 30, in <module>
asyncio.run(my_upload)
File "/opt/homebrew/Caskroom/miniconda/base/envs/orion-dev-38/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/opt/homebrew/Caskroom/miniconda/base/envs/orion-dev-38/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/opt/homebrew/Caskroom/miniconda/base/envs/orion-dev-38/lib/python3.8/site-packages/prefect_aws/s3.py", line 126, in s3_upload
logger = get_run_logger()
File "/Users/mz/dev/orion/src/prefect/logging/loggers.py", line 91, in get_run_logger
raise RuntimeError("There is no active flow or task run context.")
RuntimeError: There is no active flow or task run context.