SDK Reference
Log In
SDK Reference

The method create_link_edge creates theMRXLinkDagEdgeModel class, which specifies the parent-child relationship between components in Link SDK.

Create Link Edge

create_link_edge(parent_id: str, child_id: str) -> MRXLinkDagEdgeModel
  • Parameters

    • parent_id(str): ID of the parent component
    • child_id(str): ID of the child component
  • Returns

    • MRXLinkDagEdgeModel(parent=parent_id, child=child_id)
  • Troubleshooting

    • ValueError: The parent id and the child id '{id}' cannot be the same.
      • This occurs when parent_id and child_id are same.

Example

from mrx_link.sdk.utils import create_link_component, create_link_edge

# Code cell
code1 = """
x = 1
"""
code2 = """
print(f"{x=}, {y=}")
"""

if __name__ == "__main__":
    # Create components
    component1 = create_link_component(identifier="111-1", name="test", code=code1)
    component2 = create_link_component(identifier="111-2", name="test2", code=code2)

    # Create an edge
    edge1 = create_link_edge(parent_id="111-1", child_id="111-2")