MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/sql/lambdas.py:198–218  ·  view source on GitHub ↗
(
        self,
        fn: _LambdaType,
        role: Type[SQLRole],
        opts: Union[Type[LambdaOptions], LambdaOptions] = LambdaOptions,
        apply_propagate_attrs: Optional[ClauseElement] = None,
    )

Source from the content-addressed store, hash-verified

196 )
197
198 def __init__(
199 self,
200 fn: _LambdaType,
201 role: Type[SQLRole],
202 opts: Union[Type[LambdaOptions], LambdaOptions] = LambdaOptions,
203 apply_propagate_attrs: Optional[ClauseElement] = None,
204 ):
205 self.fn = fn
206 self.role = role
207 self.tracker_key = (fn.__code__,)
208 self.opts = opts
209
210 if apply_propagate_attrs is None and (role is roles.StatementRole):
211 apply_propagate_attrs = self
212
213 rec = self._retrieve_tracker_rec(fn, apply_propagate_attrs, opts)
214
215 if apply_propagate_attrs is not None:
216 propagate_attrs = rec.propagate_attrs
217 if propagate_attrs:
218 apply_propagate_attrs._propagate_attrs = propagate_attrs
219
220 def _retrieve_tracker_rec(self, fn, apply_propagate_attrs, opts):
221 lambda_cache = opts.lambda_cache

Callers

nothing calls this directly

Calls 1

_retrieve_tracker_recMethod · 0.95

Tested by

no test coverage detected