I have just upgraded my Airflow to 2.2.5 and I can't use the EmptyOperator. It should be simple from airflow.operators.empty import EmptyOperator
but I get the error ModuleNotFoundError: No module named 'airflow.operators.empty'
. I also tried:
from airflow.operators import empty
from empty.operators import EmptyOperator
The Airflow repo itself shows the structure that would mean
from airflow.operators.empty import EmptyOperator
should work but it doesn't so I am really puzzled as to what is going on.
EmptyOperator
was released in Airflow 2.3.0.
In Airflow 2.3.0 DummyOperator
was deprecated in favor of EmptyOperator
(See PR)
For Airflow>=2.9.0 you should use
from airflow.providers.standard.operators.empty import EmptyOperator
From the apache-airflow-providers-standard package.
For Airflow>=2.3.0, <2.9.0 you should use:
from airflow.operators.empty import EmptyOperator
Note this import will work also for >=2.9.0,<3.0 (with deprecation warning) but it's better to migrate to the standard provide import if you are running >=2.9.0
For Airflow<2.3.0 you should use:
from airflow.operators.dummy import DummyOperator