BashOperator runs a Bash command or script as one task in an Airflow DAG. Use it when a workflow step is naturally expressed as a shell command, such as downloading raw data before a Python task processes it. section 2.7 section 3.1
Download data before processing
A data pipeline can fetch event data with BashOperator and pass execution to PythonOperator for analysis. The command creates a directory and downloads the API response: `mkdir -p /data && curl -o /data/events.json http://events-api:8081/events/latest`. The resulting task can precede a Python task that loads the JSON into pandas and calculates grouped statistics. section 3.1
Connect the operator to the rest of the workflow by:
- Defining dependencies with `>>` or `<<` so downstream tasks run only after the Bash task completes successfully. section 2.2
