0

I can't seem to be able to import Mysql. like trying to import using this from airflow.operators.mysql_operator import MySqlOperator I get this error "Cannot find reference 'MySqlOperator' in 'mysql_operator.py' "

1 Answer 1

3

Assuming you are on version 2.0.0 or greater, the import would be:

from airflow.providers.mysql.operators.mysql import MySqlOperator

Remember to install the MySQL providers package first:

pip install 'apache-airflow-providers-mysql'

Here is an example from the docs.

Sign up to request clarification or add additional context in comments.

1 Comment

And If you are not on Airflow 2+ better upgrade NOW. Airflow 1.10 reached end-of-life in June 17th 2021 and it will no longer receive even critical security fixes. You can watch the discussion panel "Keep your airflow secure" from "just running" Airflow Summit 2021 crowdcast.io/e/airflowsummit2021/3 where we discussed it at length.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.