When there are operations on beanie documents in the task code, the beanie.exceptions.CollectionWasNotInitialized error is thrown.
And everything works well if the same functions are called as ordinary functions, not tasks.
There are probably some sessions in the beanie that need to be passed in such situations. Сan you tell me how to do it please?
I've found this other conversation in Stack Overflow that I think can help managing to useBeanie inside a Celery task.
How to combine Celery with asyncio?, in particular the following comment:
https://stackoverflow.com/a/57286909/1995585
I did a quick test with the suggested solution and managed to run the sample code in the Beanie documentation inside a Celery task... but certainly is a workaround until Celery properly supports asyncio.