-
Couldn't load subscription status.
- Fork 1.2k
Open
Labels
Description
save() only saves changed fields in existing documents, This is pretty fine, but it saves with upsert=True! So, if someone deleted the document in the meanwhile, we end-up with a document with only updated fields (and missing required fields). (We encountered to these mal-structured rows in our database.)
save() should not use upsert=True when updating only changed fields. It may check for results and raise an exception if no document is updated (sqlalchemy has a StaleDataError for this porpose)
wojcikstefan, villasv, TamarNevo, chiragjn, bagerard and 4 more