From 9e82f32f274e649b04740c819d21ba232c89cfff Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 3 Sep 2020 14:14:39 -0400 Subject: 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 Change-Id: I1d58c8ebe081079cb669e7ead60886ffc1b1a7f5 --- lib/sqlalchemy/dialects/postgresql/ext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/dialects/postgresql/ext.py') diff --git a/lib/sqlalchemy/dialects/postgresql/ext.py b/lib/sqlalchemy/dialects/postgresql/ext.py index 7acab0a0a..c139fe94f 100644 --- a/lib/sqlalchemy/dialects/postgresql/ext.py +++ b/lib/sqlalchemy/dialects/postgresql/ext.py @@ -205,7 +205,7 @@ class ExcludeConstraint(ColumnCollectionConstraint): if where is not None: self.where = coercions.expect(roles.StatementOptionRole, where) - def _set_parent(self, table): + def _set_parent(self, table, **kw): super(ExcludeConstraint, self)._set_parent(table) self._render_exprs = [ -- cgit v1.2.1