Hi, I have a class like:
class SQLClass(db): json_field = Column(sqlalchemy.dialects.postgresql.JSONB) I'm doing something like: session.add( SQLClass(json_field = dict( key = [value1] ) )) session.commit() slq_class_obj = session.query(SQLClass).first() new_dict = slq_class_obj.json_field new_dict['key'].append(value2) slq_class_obj. json_field = new_dict print(slq_class_obj. json_field) # looks OK session.commt() print(slq_class_obj. json_field) # I just get [value1] The changes I made to json field (new_dict) were not persisted. However, if just change the json_field to be an empty dict that is persisted. I know there are some issues with mutation and the JSON data type, but I thought since I was setting the field value rather than just mutating the dict in place the mutation would be tracked. Why is setting the field to an empty dict persisted while my change is not? Any general advice on handling JSON and mutation would also be welcome. Thank you for your help! ~Victor -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.