Can't import Airflow plugins

后端 未结 11 1259
傲寒
傲寒 2021-01-03 18:10

Following Airflow tutorial here.

Problem: The webserver returns the following error

Broken DAG: [/usr/local/airflow/dags/test_operat         


        
11条回答
  •  耶瑟儿~
    2021-01-03 18:53

    Let's say, following is the custom plugin that you have implemented in my_operators.py,

    class MyFirstPlugin(AirflowPlugin):
        name = "my_first_plugin"
        operators = [MyFirstOperator]
    

    Then as per the Airflow documentation, you have to import in the following structure,

    from airflow.{type, like "operators", "sensors"}.{name specified inside the plugin class} import *
    

    So, you should import like the following in your case,

    from airflow.operators.my_first_plugin import MyFirstOperator
    

提交回复
热议问题