MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _validate_persistent

Method _validate_persistent

lib/sqlalchemy/orm/session.py:4293–4298  ·  view source on GitHub ↗
(self, state: InstanceState[Any])

Source from the content-addressed store, hash-verified

4291 return merged
4292
4293 def _validate_persistent(self, state: InstanceState[Any]) -> None:
4294 if not self.identity_map.contains_state(state):
4295 raise sa_exc.InvalidRequestError(
4296 "Instance '%s' is not persistent within this Session"
4297 % state_str(state)
4298 )
4299
4300 def _save_impl(self, state: InstanceState[Any]) -> None:
4301 if state.key is not None:

Callers 1

_expire_stateMethod · 0.95

Calls 2

state_strFunction · 0.85
contains_stateMethod · 0.45

Tested by

no test coverage detected