MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / replace

Method replace

lib/sqlalchemy/orm/relationships.py:2573–2585  ·  view source on GitHub ↗
(element: _CE, **kw: Any)

Source from the content-addressed store, hash-verified

2571 if self._has_remote_annotations:
2572
2573 def replace(element: _CE, **kw: Any) -> Optional[_CE]:
2574 if "remote" in element._annotations:
2575 v = dict(element._annotations)
2576 del v["remote"]
2577 v["local"] = True
2578 return element._with_annotations(v)
2579 elif "local" in element._annotations:
2580 v = dict(element._annotations)
2581 del v["local"]
2582 v["remote"] = True
2583 return element._with_annotations(v)
2584
2585 return None
2586
2587 return visitors.replacement_traverse(self.primaryjoin, {}, replace)
2588 else:

Callers

nothing calls this directly

Calls 1

_with_annotationsMethod · 0.45

Tested by

no test coverage detected