Airflow Summit 2026 is coming August 31 - September 2 in Austin, TX. Register now to secure your spot!

airflow.providers.standard.example_dags.example_python_operator

### Python operators

Example DAG demonstrating classic Python operators.

This DAG shows several ways to execute Python callables in Airflow: PythonOperator for regular Python functions, PythonVirtualenvOperator for functions that need an isolated virtual environment, and ExternalPythonOperator for running a callable with a specific Python binary.

It also demonstrates passing keyword arguments, rendering templated files, and using asynchronous Python callables.

See also: https://airflow.apache.org/docs/apache-airflow-providers-standard/stable/operators/python.html

Attributes

log

PATH_TO_PYTHON_BINARY

Functions

print_context([ds])

Print the Airflow context and ds variable from the context.

Module Contents

airflow.providers.standard.example_dags.example_python_operator.log[source]
airflow.providers.standard.example_dags.example_python_operator.PATH_TO_PYTHON_BINARY = '/usr/local/bin/python3'[source]
airflow.providers.standard.example_dags.example_python_operator.print_context(ds=None, **kwargs)[source]

Print the Airflow context and ds variable from the context.

Was this entry helpful?