<p dir="auto"><strong>Apache Airflow version</strong>: 1.10.15</p>
<p dir="auto"><strong>Kubernetes version (if you are using kubernetes)</strong> (use <code class="notranslate">kubectl version</code>):</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>OS</strong> (e.g. from /etc/os-release): Redhat 8.3</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">Installed airflow with pip, it picked up sql alchemy 1.4.6 as a dependency.</p>
<p dir="auto">This causes airflow to fil to run as flask-admin 1.5.4 is not compatible with sqlalchemy 1.4.  flask-admin 1.5.6 is however.</p>
<p dir="auto">Traceback (most recent call last):<br>
File "/usr/local/bin/airflow", line 26, in <br>
from airflow.bin.cli import CLIFactory<br>
File "/usr/local/lib/python3.8/site-packages/airflow/bin/cli.py", line 82, in <br>
from airflow.www.app import (cached_app, create_app)<br>
File "/usr/local/lib/python3.8/site-packages/airflow/www/app.py", line 42, in <br>
from airflow.www.blueprints import routes<br>
File "/usr/local/lib/python3.8/site-packages/airflow/www/blueprints.py", line 25, in <br>
from airflow.www import utils as wwwutils<br>
File "/usr/local/lib/python3.8/site-packages/airflow/www/utils.py", line 40, in <br>
import flask_admin.contrib.sqla.filters as sqlafilters<br>
File "/usr/local/lib/python3.8/site-packages/flask_admin/contrib/sqla/<strong>init</strong>.py", line 2, in <br>
from .view import ModelView<br>
File "/usr/local/lib/python3.8/site-packages/flask_admin/contrib/sqla/view.py", line 18, in <br>
from flask_admin.contrib.sqla.tools import is_relationship<br>
File "/usr/local/lib/python3.8/site-packages/flask_admin/contrib/sqla/tools.py", line 4, in <br>
from sqlalchemy.ext.declarative.clsregistry import _class_resolver<br>
ModuleNotFoundError: No module named 'sqlalchemy.ext.declarative.clsregistry'</p>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">setup.py has a dependency on sqlalchemy=~1.3 so should not pull 1.4</p>
<p dir="auto"><strong>How to reproduce it</strong>:</p>
<p dir="auto">pip install "apache-airflow &lt; 2.0"<br>
airflow version</p>

<p dir="auto">the pip install log shows:</p>
<p dir="auto">Collecting sqlalchemy~=1.3<br>
Downloading SQLAlchemy-1.4.6-cp38-cp38-manylinux2014_x86_64.whl (1.5 MB)</p>
<p dir="auto">How often does this problem occur? Once? Every time etc?</p>
<p dir="auto">Every time.</p>
<p dir="auto"><strong>Apache Airflow version</strong>: 2.0.1</p>
<p dir="auto"><strong>Kubernetes version (if you are using kubernetes)</strong> (use <code class="notranslate">kubectl version</code>): N/A</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>:</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): Mac OS Big Sur</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):</li>
<li><strong>Install tools</strong>: pip 20.1.1</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">Our CI environment broke due to the release of SQLAlchemy 1.4, which is incompatible with the latest version of sqlalchemy-utils. (<a href="https://github.com/kvesteri/sqlalchemy-utils/issues/505" data-hovercard-type="issue" data-hovercard-url="/kvesteri/sqlalchemy-utils/issues/505/hovercard">Related issue</a>)</p>
<p dir="auto">Partial stacktrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  File &quot;/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/airflow/www/utils.py&quot;, line 27, in &lt;module&gt;
    from flask_appbuilder.models.sqla.interface import SQLAInterface
  File &quot;/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py&quot;, line 16, in &lt;module&gt;
    from sqlalchemy_utils.types.uuid import UUIDType
  File &quot;/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/__init__.py&quot;, line 1, in &lt;module&gt;
    from .aggregates import aggregated  # noqa
  File &quot;/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py&quot;, line 372, in &lt;module&gt;
    from .functions.orm import get_column_key
  File &quot;/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/__init__.py&quot;, line 1, in &lt;module&gt;
    from .database import (  # noqa
  File &quot;/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py&quot;, line 11, in &lt;module&gt;
    from .orm import quote
  File &quot;/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/orm.py&quot;, line 14, in &lt;module&gt;
    from sqlalchemy.orm.query import _ColumnEntity
ImportError: cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query' (/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py)"><pre class="notranslate"><code class="notranslate">  File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/airflow/www/utils.py", line 27, in &lt;module&gt;
    from flask_appbuilder.models.sqla.interface import SQLAInterface
  File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py", line 16, in &lt;module&gt;
    from sqlalchemy_utils.types.uuid import UUIDType
  File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/__init__.py", line 1, in &lt;module&gt;
    from .aggregates import aggregated  # noqa
  File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py", line 372, in &lt;module&gt;
    from .functions.orm import get_column_key
  File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/__init__.py", line 1, in &lt;module&gt;
    from .database import (  # noqa
  File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 11, in &lt;module&gt;
    from .orm import quote
  File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/orm.py", line 14, in &lt;module&gt;
    from sqlalchemy.orm.query import _ColumnEntity
ImportError: cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query' (/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py)
</code></pre></div>
<p dir="auto">I'm not sure what the typical procedure is in the case of breaking changes to dependencies, but seeing as there's an upcoming release I thought it might be worth pinning sqlalchemy to 1.3.x? (Or pin the version of sqlalchemy-utils to a compatible version if one is released before Airflow 2.0.2)</p>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto"><code class="notranslate">airflow db init</code> to run successfully.</p>

<p dir="auto"><strong>How to reproduce it</strong>:</p>
<ol dir="auto">
<li>Create a new virtualenv</li>
<li><code class="notranslate">pip install apache-airflow</code></li>
<li><code class="notranslate">airflow db init</code></li>
</ol>