]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- Some changes to how the :attr:`.FromClause.c` collection behaves
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 26 Feb 2014 20:34:49 +0000 (15:34 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 26 Feb 2014 20:34:49 +0000 (15:34 -0500)
commit302ad6228a12fe5cb4c5d332e5bab65ed373bc01
tree9e39551b168090a75c28c1d5ba45ef24cdbfc1da
parentbf67069d264cba3feed8a48614289d605ed61a55
- Some changes to how the :attr:`.FromClause.c` collection behaves
when presented with duplicate columns.  The behavior of emitting a
warning and replacing the old column with the same name still
remains to some degree; the replacement in particular is to maintain
backwards compatibility.  However, the replaced column still remains
associated with the ``c`` collection now in a collection ``._all_columns``,
which is used by constructs such as aliases and unions, to deal with
the set of columns in ``c`` more towards what is actually in the
list of columns rather than the unique set of key names.  This helps
with situations where SELECT statements with same-named columns
are used in unions and such, so that the union can match the columns
up positionally and also there's some chance of :meth:`.FromClause.corresponding_column`
still being usable here (it can now return a column that is only
in selectable.c._all_columns and not otherwise named).
The new collection is underscored as we still need to decide where this
list might end up.   Theoretically it
would become the result of iter(selectable.c), however this would mean
that the length of the iteration would no longer match the length of
keys(), and that behavior needs to be checked out.
fixes #2974
- add a bunch more tests for ColumnCollection
doc/build/changelog/changelog_09.rst
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/selectable.py
test/base/test_utils.py
test/sql/test_selectable.py