]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
mock _NONE_NAME for < 1.3.24
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Mar 2023 16:07:33 +0000 (11:07 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Mar 2023 20:26:13 +0000 (15:26 -0500)
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
alembic/util/sqla_compat.py
docs/build/unreleased/1196.rst [new file with mode: 0644]

index 2cc070b66531217d937179cf7080b0df2d2b8b3c..a767e7da2826045b01e5e91c7df9d117ddec4fdd 100644 (file)
@@ -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 (file)
index 0000000..a0f0e60
--- /dev/null
@@ -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.