summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-07-01 13:19:28 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-07-01 13:19:28 -0400
commitee34f7276b8ce7ef4b5c746b5adf8f8c65f7c826 (patch)
tree6c120a4652b2ca80974973dbcc54c045ea180bec /lib/sqlalchemy/orm
parent4d6f4ed184b94e60d5d39eff7fae678d64e9aeaa (diff)
downloadsqlalchemy-ee34f7276b8ce7ef4b5c746b5adf8f8c65f7c826.tar.gz
- Fixed 1.0 regression where value objects that override
``__eq__()`` to return a non-boolean-capable object, such as some geoalchemy types as well as numpy types, were being tested for ``bool()`` during a unit of work update operation, where in 0.9 the return value of ``__eq__()`` was tested against "is True" to guard against this. fixes #3469
Diffstat (limited to 'lib/sqlalchemy/orm')
-rw-r--r--lib/sqlalchemy/orm/persistence.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py
index 4f074df8e..0bfee2ece 100644
--- a/lib/sqlalchemy/orm/persistence.py
+++ b/lib/sqlalchemy/orm/persistence.py
@@ -455,8 +455,10 @@ def _collect_update_commands(
if isinstance(value, sql.ClauseElement):
value_params[col] = value
- elif not state.manager[propkey].impl.is_equal(
- value, state.committed_state[propkey]):
+ # guard against values that generate non-__nonzero__
+ # objects for __eq__()
+ elif state.manager[propkey].impl.is_equal(
+ value, state.committed_state[propkey]) is not True:
params[col.key] = value
if update_version_id is not None and \