Issue 1:
Apache Airflow version: 1.10.15

Kubernetes version (if you are using kubernetes) (use kubectl version):

Environment:

OS (e.g. from /etc/os-release): Redhat 8.3

What happened:

Installed airflow with pip, it picked up sql alchemy 1.4.6 as a dependency.

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.

Traceback (most recent call last):

File "/usr/local/bin/airflow", line 26, in

from airflow.bin.cli import CLIFactory

File "/usr/local/lib/python3.8/site-packages/airflow/bin/cli.py", line 82, in

from airflow.www.app import (cached_app, create_app)

File "/usr/local/lib/python3.8/site-packages/airflow/www/app.py", line 42, in

from airflow.www.blueprints import routes

File "/usr/local/lib/python3.8/site-packages/airflow/www/blueprints.py", line 25, in

from airflow.www import utils as wwwutils

File "/usr/local/lib/python3.8/site-packages/airflow/www/utils.py", line 40, in

import flask_admin.contrib.sqla.filters as sqlafilters

File "/usr/local/lib/python3.8/site-packages/flask_admin/contrib/sqla/init.py", line 2, in

from .view import ModelView

File "/usr/local/lib/python3.8/site-packages/flask_admin/contrib/sqla/view.py", line 18, in

from flask_admin.contrib.sqla.tools import is_relationship

File "/usr/local/lib/python3.8/site-packages/flask_admin/contrib/sqla/tools.py", line 4, in

from sqlalchemy.ext.declarative.clsregistry import _class_resolver

ModuleNotFoundError: No module named 'sqlalchemy.ext.declarative.clsregistry'

What you expected to happen:

setup.py has a dependency on sqlalchemy=~1.3 so should not pull 1.4

How to reproduce it:

pip install "apache-airflow < 2.0"

airflow version

the pip install log shows:

Collecting sqlalchemy~=1.3

Downloading SQLAlchemy-1.4.6-cp38-cp38-manylinux2014_x86_64.whl (1.5 MB)

How often does this problem occur? Once? Every time etc?

Every time.

Issue 2:
Apache Airflow version: 2.0.1

Kubernetes version (if you are using kubernetes) (use kubectl version): N/A

Environment:

Cloud provider or hardware configuration:

OS (e.g. from /etc/os-release): Mac OS Big Sur

Kernel (e.g. uname -a):

Install tools: pip 20.1.1

Others:

What happened:

Our CI environment broke due to the release of SQLAlchemy 1.4, which is incompatible with the latest version of sqlalchemy-utils. (Related issue)

Partial stacktrace:

File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/airflow/www/utils.py", line 27, in <module>
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 <module>
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 <module>
from .aggregates import aggregated # noqa
File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py", line 372, in <module>
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 <module>
from .database import ( # noqa
File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 11, in <module>
from .orm import quote
File "/Users/samwheating/Desktop/tmp_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/orm.py", line 14, in <module>
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)

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)

What you expected to happen:

airflow db init to run successfully.

How to reproduce it:

Create a new virtualenv

pip install apache-airflow

airflow db init