question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Latest SQLAlchemy (1.4) Incompatible with latest sqlalchemy_utils

See original GitHub issue

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:

  1. Create a new virtualenv
  2. pip install apache-airflow
  3. airflow db init

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
kaxilcommented, Mar 18, 2021

@jonasrla If you install Airflow with constraints file you won’t need to do that:

https://github.com/apache/airflow#installing-from-pypi

Example:

pip install apache-airflow==2.0.1 \
 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.0.1/constraints-3.7.txt"
6reactions
jonasrlacommented, Mar 18, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found