On bulk update, the state is discarded at some point, causing an exception
I've asked about this issue on Stack Overflow: http://stackoverflow.com/questions/32407210/sqlalchemy-nonetype-object-has-no-attribute-expire-attributes-on-bulk-upda
However, I kept digging and have chased it to the persistence._bulk_update
function, which replaces all states with None
, causing the error shown in the SO question above. I've thrown together a brief patch which seems to fix the issue; will see if I can make a pull request out of it.
Comments (9)
-
reporter -
reporter - changed status to invalid
Incorrectly identified as issue, sorry! See http://stackoverflow.com/questions/32407210/sqlalchemy-nonetype-object-has-no-attribute-expire-attributes-on-bulk-upda/32436116#32436116 for explanation.
-
reporter - changed status to closed
-
reporter - changed status to invalid
-
repo owner - changed status to open
it sure looks like a bug to me, can you please illustrate a real test case?
-
repo owner - changed status to resolved
- Fixed bug in :meth:
.Session.bulk_save_objects
where a mapped column that had some kind of "fetch on update" value and was not locally present in the given object would cause an AttributeError within the operation. fixes#3525
→ <<cset 68a6701c6d72>>
-
repo owner - Fixed bug in :meth:
.Session.bulk_save_objects
where a mapped column that had some kind of "fetch on update" value and was not locally present in the given object would cause an AttributeError within the operation. fixes#3525
(cherry picked from commit 68a6701c6d72d6c6ef1ea2b7d615273659e8b735)
→ <<cset 55ec07c46c33>>
- Fixed bug in :meth:
-
reporter Hi Mike, sorry for not responding sooner, and thanks for taking care of that bug. I wasn't sure if it was intended to work that way (as the documentation states that the bulk methods don't support the relationships); it took me quite some time to figure out why is this happening.
-
repo owner see also
#3526where in 1.1 the system has been cleaned up some more - Log in to comment
My apologies, this turns out to be a non issue; I've explained my problem and solution here: http://stackoverflow.com/a/32436116/122033