From: Mike Bayer Date: Tue, 7 Mar 2023 16:07:33 +0000 (-0500) Subject: mock _NONE_NAME for < 1.3.24 X-Git-Tag: rel_1_10_2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c46243f23bd258744e3417566a52ca3ab312d70;p=thirdparty%2Fsqlalchemy%2Falembic.git mock _NONE_NAME for < 1.3.24 Fixed regression where Alembic would not run with older SQLAlchemy 1.3 versions prior to 1.3.24 due to a missing symbol. Workarounds have been applied for older 1.3 versions. Change-Id: Ie7b5f6295e55276f0e912bf2b10b8c96dad171b9 Fixes: #1196 --- diff --git a/alembic/util/sqla_compat.py b/alembic/util/sqla_compat.py index 2cc070b6..a767e7da 100644 --- a/alembic/util/sqla_compat.py +++ b/alembic/util/sqla_compat.py @@ -27,7 +27,6 @@ from sqlalchemy.sql.elements import ColumnClause from sqlalchemy.sql.elements import quoted_name from sqlalchemy.sql.elements import TextClause from sqlalchemy.sql.elements import UnaryExpression -from sqlalchemy.sql.naming import _NONE_NAME as _NONE_NAME from sqlalchemy.sql.visitors import traverse from typing_extensions import TypeGuard @@ -66,6 +65,11 @@ sqla_14_26 = _vers >= (1, 4, 26) sqla_2 = _vers >= (2,) sqlalchemy_version = __version__ +try: + from sqlalchemy.sql.naming import _NONE_NAME as _NONE_NAME +except ImportError: + from sqlalchemy.sql.elements import _NONE_NAME as _NONE_NAME # type: ignore # noqa: E501 + if sqla_14: # when future engine merges, this can be again based on version string diff --git a/docs/build/unreleased/1196.rst b/docs/build/unreleased/1196.rst new file mode 100644 index 00000000..a0f0e60f --- /dev/null +++ b/docs/build/unreleased/1196.rst @@ -0,0 +1,7 @@ +.. change:: + :tags: bug, ops + :tickets: 1196 + + Fixed regression where Alembic would not run with older SQLAlchemy 1.3 + versions prior to 1.3.24 due to a missing symbol. Workarounds have been + applied for older 1.3 versions.