Following Airflow tutorial here.
Problem: The webserver returns the following error
Broken DAG: [/usr/local/airflow/dags/test_operat
In the article it does like this:
class MyFirstPlugin(AirflowPlugin):
name = "my_first_plugin"
operators = [MyFirstOperator]
Instead use:
class MyFirstPlugin(AirflowPlugin):
name = "my_first_plugin"
operators = [MyFirstOperator]
# A list of class(es) derived from BaseHook
hooks = []
# A list of class(es) derived from BaseExecutor
executors = []
# A list of references to inject into the macros namespace
macros = []
# A list of objects created from a class derived
# from flask_admin.BaseView
admin_views = []
# A list of Blueprint object created from flask.Blueprint
flask_blueprints = []
# A list of menu links (flask_admin.base.MenuLink)
menu_links = []
Also don't use:
from airflow.operators import MyFirstOperator
According to the airflow article on plugins, it should be:
from airflow.operators.my_first_plugin import MyFirstOperator
If that doesn't work try:
from airflow.operators.my_operators import MyFirstOperator
If that doesn't work, check your web server log on startup for more information.