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

Function _parse_mapper_argument

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

Source from the content-addressed store, hash-verified

530
531
532def _parse_mapper_argument(arg: Union[Mapper[_O], Type[_O]]) -> Mapper[_O]:
533 insp = inspection.inspect(arg, raiseerr=False)
534 if insp_is_mapper(insp):
535 return insp
536
537 raise sa_exc.ArgumentError(f"Mapper or mapped class expected, got {arg!r}")
538
539
540def 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