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
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
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
--- /dev/null
+.. 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.