edelooff / sqlalchemy-json

Full-featured JSON type with mutation tracking for SQLAlchemy
http://variable-scope.com/posts/mutation-tracking-in-nested-json-structures-using-sqlalchemy
BSD 2-Clause "Simplified" License
189 stars 34 forks source link

Support pickling #36

Closed anler closed 1 year ago

anler commented 2 years ago

Hello,

I've seen you added support for pickling, but it does not take into account Mutable._parents which is WeakKeyDict that cannot be pickled, see Supporting Pickling in SQLAlchemy.

Your pickling tests pass because Mutable._parents is memoized property so it won't create the dict until you access it. See these changes I've made and that cause the test to fail: https://github.com/anler/sqlalchemy-json/commit/a36b612cc8065c9cff5af93989fa37150759d1a1

Thanks!