]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Warn instead of raise for unmapped column that matches on key
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 10 Sep 2017 04:01:18 +0000 (00:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 10 Sep 2017 04:01:18 +0000 (00:01 -0400)
commitdb170dd4529c5176d38db649dd75427a932b47fe
treef7f25635bb520f34aa4d2b22d63d06592b58a00a
parentca2c42df6ba108289031ccecd030b7aa196a66d6
Warn instead of raise for unmapped column that matches on key

Modified the change made to the ORM update/delete evaluator in
:ticket:`3366` such that if an unmapped column expression is present
in the update or delete, if the evaluator can match its name to the
mapped columns of the target class, a warning is emitted, rather than
raising UnevaluatableError.  This is essentially the pre-1.2 behavior,
and is to allow migration for applications that are currently relying
upon this pattern.  However, if the given attribute name cannot be
matched to the columns of the mapper, the UnevaluatableError is
still raised, which is what was fixed in :ticket:`3366`.

Change-Id: I658ed0dbf485b7f8009774f9c12d9912447abd2a
Fixes: #4073
doc/build/changelog/unreleased_12/4073.rst [new file with mode: 0644]
lib/sqlalchemy/orm/evaluator.py
lib/sqlalchemy/orm/persistence.py
test/orm/test_evaluator.py