MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / visit_unary

Method visit_unary

lib/sqlalchemy/orm/evaluator.py:342–358  ·  view source on GitHub ↗
(self, clause)

Source from the content-addressed store, hash-verified

340 )
341
342 def visit_unary(self, clause):
343 eval_inner = self.process(clause.element)
344 if clause.operator is operators.inv:
345
346 def evaluate(obj):
347 value = eval_inner(obj)
348 if value is _EXPIRED_OBJECT:
349 return _EXPIRED_OBJECT
350 elif value is None:
351 return None
352 return not value
353
354 return evaluate
355 raise UnevaluatableError(
356 f"Cannot evaluate {type(clause).__name__} "
357 f"with operator {clause.operator}"
358 )
359
360 def visit_bindparam(self, clause):
361 if clause.callable:

Callers

nothing calls this directly

Calls 2

processMethod · 0.95
UnevaluatableErrorClass · 0.85

Tested by

no test coverage detected