MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / proc_left_right

Method proc_left_right

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

Source from the content-addressed store, hash-verified

2864 )
2865
2866 def proc_left_right(
2867 left: ColumnElement[Any], right: ColumnElement[Any]
2868 ) -> Tuple[ColumnElement[Any], ColumnElement[Any]]:
2869 if isinstance(left, expression.ColumnClause) and isinstance(
2870 right, expression.ColumnClause
2871 ):
2872 if self.child_persist_selectable.c.contains_column(
2873 right
2874 ) and self.parent_persist_selectable.c.contains_column(left):
2875 right = right._annotate({"remote": True})
2876 elif (
2877 check_entities
2878 and right._annotations.get("parentmapper") is self.prop.mapper
2879 ):
2880 right = right._annotate({"remote": True})
2881 elif (
2882 check_entities
2883 and left._annotations.get("parentmapper") is self.prop.mapper
2884 ):
2885 left = left._annotate({"remote": True})
2886 else:
2887 self._warn_non_column_elements()
2888
2889 return left, right
2890
2891 self.primaryjoin = visitors.cloned_traverse(
2892 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