Using Airflow dev locally I found my new DAG threw this error:
DAG Import Errors (1)
Broken DAG: [/usr/local/airflow/dags/my_new_dag.py] Traceback (most recent call last):
File "", line 228, in _call_with_frames_removed
File "/usr/local/airflow/dags/my_new_dag.py", line 2, in
import mysql.connector
ModuleNotFoundError: No module named 'mysql'
First, check you have added the connector to the requirements.txt in the root of the project:
mysql-connector==2.2.9
Then, you need to restart Airflow for it to pick up the new requirement, for example with astronomer:
c:\> astro dev restart
You’ll see it installs the new requirement and the DAG now works.
Comments