Search code examples
pythonconnectionairflow

How can I add new "Conn Types" to Airflow 2.0?


I'm learning Apache Airflow 2.0 and I was creating a new "Connection" but in "Conn Type" there are just a few options, for example I want to add a MySQL connection but there isn't that option. In this post (Apache Airflow - Connection issue to MS SQL Server using pymssql + SQLAlchemy) you can see they have a lot of conn types and I want to know how to create or add new types, right now I need MySQL type but it is probable I need more in the future (like AWS, GCP, etc). I had to create a connection from the CLI but if I edit it from the UI, the conn type is lost so it's a problem...

So they have all those options in conn type: enter image description here

And I have just these options: enter image description here


Solution

  • You need to use MySQL Provider to do that either via:

    pip install -U 'apache-airflow[mysql]'
    

    or

    pip install -U apache-airflow-providers-mysql
    

    http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow-providers/index.html#extending-airflow-connections-and-extra-links-via-providers

    From Airflow 2.0.0, the connection type would only be show for the Providers that are already installed.