Running asyncio task in Databricks
Standard method to run asyncio task is as simple as
asyncio.run(main())
. But in Databricks, it is not that simple. With the same command, you will get the following error:
Indeed, in Databricks, we've already in a running loop:
OK but achieved.
This uses a third party module
nest_asyncio
to allow nested asyncio event loops. You can find the solution in
this thread
. It works, and
nest_asyncio
is already embedded in Databricks runtimes (including the latest
runtime version 14.3 LTS
).
But the module
nest_asyncio
has been
achieved by the author
since March 6 2024 very recently.
Failed.
Failed.
Failed.
Failed.
Works in Databricks interactive mode, but not in Databricks jobs. In job cluster, we got error:
Failed.
Works in Databricks interactive mode, but not in Databricks jobs. In job cluster, we got error: