PythonOperator
Apache AirflowExecutes a Python callable
Access Instructions
Install the Apache Airflow provider package into your Airflow environment.
Import the module into your DAG file and instantiate it with your desired params.
Parameters
Documentation
Executes a Python callable
See also
For more information on how to use this operator, take a look at the guide: PythonOperator
When running your callable, Airflow will pass a set of keyword arguments that can be used in your function. This set of kwargs correspond exactly to what you can use in your jinja templates. For this to work, you need to define **kwargs
in your function header, or you can add directly the keyword arguments you would like to get - for example with the below code your callable will get the values of ti
and next_ds
context variables.
With explicit arguments:
def my_python_callable(ti, next_ds):pass
With kwargs:
def my_python_callable(**kwargs):ti = kwargs["ti"]next_ds = kwargs["next_ds"]
Example DAGs
Example Airflow DAG that shows the complex DAG structure.
Example DAG demonstrating the usage of the PythonOperator.
Example DAG demonstrating the usage of XComs.
Example usage of the TriggerDagRunOperator. This example holds 2 DAGs: 1. 1st DAG (example_trigger_controller_dag) holds a TriggerDagRunOperator, which will trigger the 2nd DAG 2. 2nd DAG (example_tri…
Example DAG demonstrating the usage of the params arguments in templated arguments.
Example DAG demonstrating the usage of the XComArgs.
This is an example dag for using the Kubernetes Executor.
Example DAG demonstrating how to implement Microsoft Teams alerting and notifications.
Example DAG demonstrating how to implement alerting and notifications for multiple Microsoft Teams channels.
Example DAG demonstrating how to implement alerting and notifications in Slack.
Example DAG demonstrating how to implement alerting and notifications for multiple Slack channels
Example DAG that queries the Airflow Metadata Database and moves data through GCS to Postgres.
### Example lakeFS DAG