Hi. How to call sync task in async flow?(Prefect 2...
# prefect-community
v
Hi. How to call sync task in async flow?(Prefect 2)
1
m
Hey! There are should be no errors. Just try running it like you normally do.
v
It hangs, I found a workaround to make task async and now I can run it in both: sync and async flows.
👍 1
j
Gals you got it working, Max, but it should work right off the bat. Can you share a MRE?
m
what is MRE?
v
Copy code
@task()
def sync_task():
    get_run_logger().log('I am sync task')


@flow()
async def sample() -> None:
    sync_task()


if __name__ == '__main__':
    asyncio.run(sample())
🙌 1
n
hey @max - MRE is just an acronym for Minimum Reproducible Example, so a little code snippet that captures a described issue and only contains code directly related to that issue
👍 1
m
@Nate 😄 thanks!
👍 1