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

Method _only_full_mapper_zero

lib/sqlalchemy/orm/query.py:343–354  ·  view source on GitHub ↗
(self, methname: str)

Source from the content-addressed store, hash-verified

341 return None
342
343 def _only_full_mapper_zero(self, methname: str) -> Mapper[Any]:
344 if (
345 len(self._raw_columns) != 1
346 or "parententity" not in self._raw_columns[0]._annotations
347 or not self._raw_columns[0].is_selectable
348 ):
349 raise sa_exc.InvalidRequestError(
350 "%s() can only be used against "
351 "a single mapped class." % methname
352 )
353
354 return self._raw_columns[0]._annotations["parententity"] # type: ignore # noqa: E501
355
356 def _set_select_from(
357 self, obj: Iterable[_FromClauseArgument], set_base_alias: bool

Callers 1

_get_implMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected