how to create custom operators in airflow and use them in airflow template which is running through cloud composer(in google cloud platform)

saicharan picture saicharan · Nov 28, 2018 · Viewed 8.1k times · Source

I need to create a custom airflow operator which I should be able to use in airflow template(Written in python) which is running in cloud composer...

If I create custom airflow operator how can I use it in a template which is running on the cloud(how to make it available for everyone so that they can use that operator)

Answer

kaxil picture kaxil · Nov 28, 2018

You need to use Airflow Plugins. https://airflow.apache.org/plugins.html

Airflow has a simple plugin manager built-in that can integrate external features to its core by simply dropping files in your $AIRFLOW_HOME/plugins folder. The python modules in the plugins folder get imported, and hooks, operators, sensors, macros, executors and web views get integrated to Airflow’s main collections and become available for use.

Take a look at examples here: https://github.com/airflow-plugins