[Sqlalchemy-tickets] Issue #4117: all_orm_descriptors contains deleted attribute (zzzeek/sqlalchemy
Brought to you by:
zzzeek
From: dima-starosud <iss...@bi...> - 2017-10-19 14:12:19
|
New issue 4117: all_orm_descriptors contains deleted attribute https://bitbucket.org/zzzeek/sqlalchemy/issues/4117/all_orm_descriptors-contains-deleted dima-starosud: This is using sqlalchemy 1.2.0b3. Please consider following code snippet. ``` #!python class A(Base): __tablename__ = 'a' id = Column(Integer, primary_key=True) value = Column(String) mapper = inspect(A).mapper print('Initial', mapper.all_orm_descriptors.keys()) A.value_2 = hybrid_property(lambda me: me.value) configure_mappers() print('Added', mapper.all_orm_descriptors.keys()) del A.value_2 configure_mappers() print('Deleted', mapper.all_orm_descriptors.keys()) from sqlalchemy.orm.mapper import _memoized_configured_property _memoized_configured_property.expire_instance(mapper) print('Expired', mapper.all_orm_descriptors.keys()) ``` I think `_memoized_configured_property` is not supposed to be used outside lib code. Is there *official* way to do this? |