如何在 airflow 中创建自定义运算符并在 运行 通过 cloud composer 的 airflow 模板中使用它们(在 google 云平台中)

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

我需要创建一个自定义气流运算符,我应该能够在气流模板中使用它(写在 python 中),它是 运行 在 cloud composer 中...

如果我创建自定义气流运算符,我如何在云端 运行 的模板中使用它(如何让它对所有人可用,以便他们可以使用该运算符)

您需要使用 Airflow 插件。 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.

看看这里的例子:https://github.com/airflow-plugins