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

Method proc_left_right

lib/sqlalchemy/orm/relationships.py:2783–2806  ·  view source on GitHub ↗
(
            left: ColumnElement[Any], right: ColumnElement[Any]
        )

Source from the content-addressed store, hash-verified

2781 )
2782
2783 def proc_left_right(
2784 left: ColumnElement[Any], right: ColumnElement[Any]
2785 ) -> Tuple[ColumnElement[Any], ColumnElement[Any]]:
2786 if isinstance(left, expression.ColumnClause) and isinstance(
2787 right, expression.ColumnClause
2788 ):
2789 if self.child_persist_selectable.c.contains_column(
2790 right
2791 ) and self.parent_persist_selectable.c.contains_column(left):
2792 right = right._annotate({"remote": True})
2793 elif (
2794 check_entities
2795 and right._annotations.get("parentmapper") is self.prop.mapper
2796 ):
2797 right = right._annotate({"remote": True})
2798 elif (
2799 check_entities
2800 and left._annotations.get("parentmapper") is self.prop.mapper
2801 ):
2802 left = left._annotate({"remote": True})
2803 else:
2804 self._warn_non_column_elements()
2805
2806 return left, right
2807
2808 self.primaryjoin = visitors.cloned_traverse(
2809 self.primaryjoin, {}, {"binary": visit_binary}

Callers

nothing calls this directly

Calls 4

contains_columnMethod · 0.45
_annotateMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected