MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _parse_mapper_argument

Function _parse_mapper_argument

lib/sqlalchemy/orm/base.py:536–541  ·  view source on GitHub ↗
(arg: Union[Mapper[_O], Type[_O]])

Source from the content-addressed store, hash-verified

534
535
536def _parse_mapper_argument(arg: Union[Mapper[_O], Type[_O]]) -> Mapper[_O]:
537 insp = inspection.inspect(arg, raiseerr=False)
538 if insp_is_mapper(insp):
539 return insp
540
541 raise sa_exc.ArgumentError(f"Mapper or mapped class expected, got {arg!r}")
542
543
544def class_mapper(class_: Type[_O], configure: bool = True) -> Mapper[_O]:

Callers 1

__init__Method · 0.85

Calls 1

insp_is_mapperFunction · 0.85

Tested by

no test coverage detected