🗓️Airflow Operator
Also known as Operator (Airflow), BashOperator, PythonOperator
A ready-made Airflow template. Fill it in, and it becomes a task.
Think of it like
It is like a cookie cutter. You press it once for each cookie, and each cookie is a task.
Example
Lucy's DAG uses a SQL operator to build a table and an email operator to send the result. She writes no glue code.
Why it matters
Ready-made templates save you from writing the same code to connect again and again. A huge set of them is a big part of why Airflow spread.
Definition
Example code
python
from airflow.providers.standard.operators.bash import BashOperator
load = BashOperator(
task_id="load_orders",
bash_command="python load_orders.py",
retries=3,
)Common mistake
Key takeaways
- 1A template. Fill it in to make a task.
- 2One job each. Run a command, a query or a copy.
- 3From providers. Packages add operators for each service.