Description:
I have set up a Django project with Celery and RabbitMQ in Docker. I am trying to execute a Celery task from my API viewset, and I can see the task being received in the Celery container logs. However, the task seems to get stuck when I use Pandas with Modin.
Observation:
- Print statements above the Pandas Modin usage work fine.
- No error or exception is raised.
- Print statements after the Pandas line are not executed.
Code Example:
@shared_task
def test_pandas_df():
print("Start task")
test_df = pd.DataFrame({"A": [1, 2, 3], "B": ["a", "b", "c"]})
logger.info("Df Data :")
print(test_df)
# In my viewset:
test_pandas_df.delay()
Celery Container Log:
My end goal is to use Pandas Modin to read a CSV Data and perform some aggregations. I have created a simple test function to understand celery task execution, But I'm unable to debug the cause of task getting stuck.
I will be trying on separate Machine and using Pandas in place of Modin (although it should fallback).
I'm trying to understand, Why no error or progress is shown. Kindly guide me, If I have missed something.
[Update]
I have tried using pandas in place of modin and it works. Now the question is what is causing Modin to stuck!!
same code worked when changed import modin.pandas as pd to import pandas as pd

