Latest SQLAlchemy (1.4) Incompatible with latest sqlalchemy_utils
See original GitHub issueApache 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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:9 (5 by maintainers)
Top Results From Across the Web
1.4 Changelog — SQLAlchemy 2.0 Documentation
Fixed issues that prevented the new usage patterns for using DML with ORM objects presented at Using INSERT, UPDATE and ON CONFLICT (i.e....
Read more >SQLalchemy making errors after being updated to 1.4.0
sqlalchemy_utils is currently not compatible with SQLAlchemy > 1.4.0: Temporarily require sqlalchemy <1.4.0 to make compatible with ...
Read more >Installation — SQLAlchemy-Utils 0.38.3 documentation
To install the latest version of SQLAlchemy-Utils, you need first obtain a copy of the source. You can do that by cloning the...
Read more >invenio-db - PyPI
Pins SQLAlchemy to >=1.2.18 and <1.4 due to incompatibility between SQLAlchemy and SQLAlchemy-Utils. Version 1.0.7 (released 2020-11-08).
Read more >Release Notes — Airflow Documentation
When you use SQLAlchemy 1.4.0+, you need to use postgresql:// as the scheme in ... Adds capability of Warnings for incompatible community providers...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jonasrla If you install Airflow with constraints file you won’t need to do that:
https://github.com/apache/airflow#installing-from-pypi
Example:
Hello,
First of all, to see how things are working out about this issue checkout #https://github.com/kvesteri/sqlalchemy-utils/issues/505
I worked around this issue by forcing
pip install SQLAlchemy==1.3.23
after installing airflow, so it overrides the newer SQLAlchemy version.