summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-09-03 14:14:39 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-10-12 13:52:06 -0400
commit9e82f32f274e649b04740c819d21ba232c89cfff (patch)
tree15ba969d68aa914ffff413d1db3d2697761ba247 /lib/sqlalchemy/sql/selectable.py
parenta3e2eb7c3c3fe6b2bebd14a7e9d661b2b4519d1f (diff)
downloadsqlalchemy-9e82f32f274e649b04740c819d21ba232c89cfff.tar.gz
Deprecate duplicated column names in Table definition
The :class:`_schema.Table` class now raises a deprecation warning when columns with the same name are defined. To replace a column a new parameter :paramref:`_schema.Table.append_column.replace_existing` was added to the :meth:`_schema.Table.append_column` method. The :meth:`_expression.ColumnCollection.contains_column` will now raises an error when called with a string, suggesting the caller to use ``in`` instead. Co-authored-by: Federico Caselli <cfederico87@gmail.com> Change-Id: I1d58c8ebe081079cb669e7ead60886ffc1b1a7f5
Diffstat (limited to 'lib/sqlalchemy/sql/selectable.py')
-rw-r--r--lib/sqlalchemy/sql/selectable.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py
index 951f50ae1..eebf3b96e 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -2167,7 +2167,7 @@ class TableClause(roles.DMLTableRole, Immutable, FromClause):
else:
return self.name.encode("ascii", "backslashreplace")
- def append_column(self, c):
+ def append_column(self, c, **kw):
existing = c.table
if existing is not None and existing is not self:
raise exc.ArgumentError(