MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _queryable_attribute_unreduce

Function _queryable_attribute_unreduce

lib/sqlalchemy/orm/attributes.py:501–512  ·  view source on GitHub ↗
(
    key: str,
    mapped_class: Type[_O],
    parententity: _InternalEntityType[_O],
    entity: _ExternalEntityType[Any],
)

Source from the content-addressed store, hash-verified

499
500
501def _queryable_attribute_unreduce(
502 key: str,
503 mapped_class: Type[_O],
504 parententity: _InternalEntityType[_O],
505 entity: _ExternalEntityType[Any],
506) -> Any:
507 # this method is only used in terms of the
508 # sqlalchemy.ext.serializer extension
509 if insp_is_aliased_class(parententity):
510 return entity._get_from_serialized(key, mapped_class, parententity)
511 else:
512 return getattr(entity, key)
513
514
515class InstrumentedAttribute(QueryableAttribute[_T_co]):

Callers

nothing calls this directly

Calls 2

insp_is_aliased_classFunction · 0.85
_get_from_serializedMethod · 0.80

Tested by

no test coverage detected