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

Method visit_binary

lib/sqlalchemy/orm/relationships.py:2601–2618  ·  view source on GitHub ↗
(binary: BinaryExpression[Any])

Source from the content-addressed store, hash-verified

2599 return None
2600
2601 def visit_binary(binary: BinaryExpression[Any]) -> None:
2602 if not isinstance(
2603 binary.left, sql.ColumnElement
2604 ) or not isinstance(binary.right, sql.ColumnElement):
2605 return
2606
2607 if (
2608 "foreign" not in binary.left._annotations
2609 and "foreign" not in binary.right._annotations
2610 ):
2611 col = is_foreign(binary.left, binary.right)
2612 if col is not None:
2613 if col.compare(binary.left):
2614 binary.left = binary.left._annotate({"foreign": True})
2615 elif col.compare(binary.right):
2616 binary.right = binary.right._annotate(
2617 {"foreign": True}
2618 )
2619
2620 self.primaryjoin = visitors.cloned_traverse(
2621 self.primaryjoin, {}, {"binary": visit_binary}

Callers

nothing calls this directly

Calls 6

compareMethod · 0.45
_annotateMethod · 0.45
is_derived_fromMethod · 0.45
addMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected