MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _class_to_mapper

Function _class_to_mapper

lib/sqlalchemy/orm/base.py:439–448  ·  view source on GitHub ↗
(
    class_or_mapper: Union[Mapper[_T], Type[_T]],
)

Source from the content-addressed store, hash-verified

437
438
439def _class_to_mapper(
440 class_or_mapper: Union[Mapper[_T], Type[_T]],
441) -> Mapper[_T]:
442 # can't get mypy to see an overload for this
443 insp = inspection.inspect(class_or_mapper, False)
444 if insp is not None:
445 return insp.mapper # type: ignore
446 else:
447 assert isinstance(class_or_mapper, type)
448 raise exc.UnmappedClassError(class_or_mapper)
449
450
451def _mapper_or_none(

Callers 3

_mappers_from_specMethod · 0.85
_bulk_save_mappingsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected