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

fix 'super' object has no attribute 'coerce' error #44

Closed casualuser closed 1 year ago

casualuser commented 1 year ago

repeat fix https://github.com/edelooff/sqlalchemy-json/issues/10 for NestedMutableDict and NestedMutableList

akshay-joshi commented 1 year ago

Any idea when this PR gets merged as we are using this in the development of pgAdmin4 but facing the same issue. When will the new release?

akshay-joshi commented 1 year ago

@edelooff Can you please update, so we can decide to wait for the release or find some other way?

edelooff commented 1 year ago

@akshay-joshi apologies for the terrible delay. I'd be happy to merge this fix, but could you provide a sample case of this failing, so that regressions can be prevented?

For reference, the following test works for me locally, so I'm not quite seeing your failure scenario:

class Dummy(Base):
    __tablename__ = "dummy"
    id = Column(Integer, primary_key=True)
    content = Column(NestedMutableJson)

def test_nulls(session):
    session.add(Dummy(content={"foo": "bar"}))
    session.commit()

    element = session.query(Dummy).one()
    assert element.content is not None
    element.content = None
    session.commit()
    assert element.content is None
edelooff commented 1 year ago

Resolved with the v0.6.0 release.