MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _get_strategy

Method _get_strategy

lib/sqlalchemy/orm/interfaces.py:1148–1160  ·  view source on GitHub ↗
(self, key: _StrategyKey)

Source from the content-addressed store, hash-verified

1146 return load
1147
1148 def _get_strategy(self, key: _StrategyKey) -> LoaderStrategy:
1149 try:
1150 return self._strategies[key]
1151 except KeyError:
1152 pass
1153
1154 # run outside to prevent transfer of exception context
1155 cls = self._strategy_lookup(self, *key)
1156 # this previously was setting self._strategies[cls], that's
1157 # a bad idea; should use strategy key at all times because every
1158 # strategy has multiple keys at this point
1159 self._strategies[key] = strategy = cls(self, key)
1160 return strategy
1161
1162 def setup(
1163 self,

Callers 15

setupMethod · 0.95
create_row_processorMethod · 0.95
do_initMethod · 0.95
do_initMethod · 0.80
create_row_processorMethod · 0.80
setup_queryMethod · 0.80
__call__Method · 0.80
init_class_attributeMethod · 0.80
_load_for_pathMethod · 0.80
init_class_attributeMethod · 0.80
init_class_attributeMethod · 0.80

Calls 1

_strategy_lookupMethod · 0.95

Tested by

no test coverage detected