MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _class_to_mapper

Function _class_to_mapper

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

Source from the content-addressed store, hash-verified

433
434
435def _class_to_mapper(
436 class_or_mapper: Union[Mapper[_T], Type[_T]],
437) -> Mapper[_T]:
438 # can't get mypy to see an overload for this
439 insp = inspection.inspect(class_or_mapper, False)
440 if insp is not None:
441 return insp.mapper # type: ignore
442 else:
443 assert isinstance(class_or_mapper, type)
444 raise exc.UnmappedClassError(class_or_mapper)
445
446
447def _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