[Sqlalchemy-tickets] Issue #3640: make_transient causes field values to disappear (zzzeek/sqlalchem
Brought to you by:
zzzeek
|
From: zestyping <iss...@bi...> - 2016-01-29 08:18:39
|
New issue 3640: make_transient causes field values to disappear https://bitbucket.org/zzzeek/sqlalchemy/issues/3640/make_transient-causes-field-values-to zestyping: My intended use case was to retrieve a row from a table and add a modified copy of the row. Using SQLAlchemy, I expressed this as a query, followed by make_transient on the retrieved instance, modifying some properties on the instance, and then committing the new instance. After this point the instance is in a mysterious state, in which calling make_transient on it makes the values of its properties disappear. Attached is a minimal script that demonstrates the bug. Expected output is: ``` x.value = 1 y.value = 1 y.value = 1 ``` Actual output is: ``` sys.version = 3.5.0 (default, Sep 23 2015, 04:42:00) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] sqlalchemy.__version__ = 1.0.11 x.value = 1 y.value = 1 y.value = None ``` Same in Python 2.7: ``` sys.version = 2.7.10 (default, Jul 14 2015, 19:46:27) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] sqlalchemy.__version__ = 1.0.11 x.value = 1 y.value = 1 y.value = None ``` Also, merely accessing y.value (see the script) changes the output, which is very suspicious behaviour. |