Can't import Airflow plugins

后端 未结 11 1305
傲寒
傲寒 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 19:00

    I use airflow 1.10. If it's a custom operator that you want to import, you can upload it to the airflow plugins folder, and then in the DAG specify the import as :

    from [filename] import [classname]

    where : filename is the name of your plugin file classname is the name of your class.

    For example : If the name of your file is my_first_plugin and name of the class is MyFirstOperator then, the import would be :

    from my_first_plugin import MyFirstOperator

    Worked for me as I am using airflow 1.10

    Thanks ! Hope this helps !!

提交回复
热议问题