summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/exc.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-12-03 09:11:14 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-12-04 10:45:35 -0500
commit1284fa377e53f03cec061d7af16f269ad73fa7b9 (patch)
tree40e421506cd20f3cf8c12cba834062cd1bb0505c /lib/sqlalchemy/exc.py
parent96db7cdd53ee9004be66545989b4ac5632bb7ccf (diff)
downloadsqlalchemy-1284fa377e53f03cec061d7af16f269ad73fa7b9.tar.gz
disallow same-named columns, unchecked replacement in Table
Fixed issue where table reflection using :paramref:`.Table.extend_existing` would fail to deduplicate a same-named column if the existing :class:`.Table` used a separate key. The :paramref:`.Table.autoload_replace` parameter would allow the column to be skipped but under no circumstances should a :class:`.Table` ever have the same-named column twice. Additionally, changed deprecation warnings to exceptions as were implemented in I1d58c8ebe081079cb669e7ead60886ffc1b1a7f5 . Fixes: #8925 Change-Id: I83d0f8658177a7ffbb06e01dbca91377d1a98d49
Diffstat (limited to 'lib/sqlalchemy/exc.py')
-rw-r--r--lib/sqlalchemy/exc.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py
index fa46a46c4..c1f1a9c1c 100644
--- a/lib/sqlalchemy/exc.py
+++ b/lib/sqlalchemy/exc.py
@@ -125,6 +125,15 @@ class ArgumentError(SQLAlchemyError):
"""
+class DuplicateColumnError(ArgumentError):
+ """a Column is being added to a Table that would replace another
+ Column, without appropriate parameters to allow this in place.
+
+ .. versionadded:: 2.0.0b4
+
+ """
+
+
class ObjectNotExecutableError(ArgumentError):
"""Raised when an object is passed to .execute() that can't be
executed as SQL.