Im trying to work with custom operators in managed amazon airflow (MWAA).
the tick is that my custom operator relaying on amazon provider package that installed via pip upon setup (requirements.txt
)
The operator I'm inheritance from is EmrContainerOperator
Plugins folder within the zip I uploaded (In my case no needed hooks)
plugins
|-- __init__.py
`-- operators
|-- __init__.py
`-- my_operator.py
Within the init I defined the plugin by extending the AirflowPlugin
from airflow.plugins_manager import AirflowPlugin
from operators.my_operator import MyOperator
class MyPlugin(AirflowPlugin):
name = 'my_plugin'
operators = [MyOperator]
requirments.txt
file content
apache-airflow-providers-snowflake==3.3.0
apache-airflow-providers-amazon==2.4.0
dag-factory==0.15.0
apache-airflow-providers-slack
But Im getting annoying error:
Broken plugin: [/usr/local/airflow/plugins/operators/mys_operator.py] No module named 'airflow.providers.amazon.aws.operators.emr'