]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Deprecate duplicated column names in Table definition
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 3 Sep 2020 18:14:39 +0000 (14:14 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Oct 2020 17:52:06 +0000 (13:52 -0400)
commit9e82f32f274e649b04740c819d21ba232c89cfff
tree15ba969d68aa914ffff413d1db3d2697761ba247
parenta3e2eb7c3c3fe6b2bebd14a7e9d661b2b4519d1f
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
doc/build/changelog/unreleased_14/table_no_dupe_cols.rst [new file with mode: 0644]
examples/versioned_history/history_meta.py
lib/sqlalchemy/dialects/postgresql/ext.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/orm/decl_base.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/selectable.py
test/base/test_utils.py
test/sql/test_defaults.py
test/sql/test_metadata.py