Can you perform the same logic or different logic within one task or within one stage?
💡 Model Answer
In Airflow, a task is intended to be an atomic unit of work, so it should perform a single logical operation. If you need to run multiple distinct operations, you can either create separate tasks or use a PythonOperator that calls multiple functions. A stage, in the context of a DAG, is a grouping of tasks that can run concurrently. Within a stage you can have many tasks, each with its own logic. Therefore, you typically keep one logic per task and use stages to orchestrate parallel execution.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.
Get Assisting AI — Starts at ₹500