create_link_edge는 Link SDK에서의 컴포넌트들 사이의 부모 자식 관계를 지정하는 클래스인 MRXLinkDagEdgeModel을 생성하는 메소드입니다.

Edge 객체 생성

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

    • parent_id(str): 부모 컴포넌트의 ID
    • child_id(str): 자식 컴포넌트의 ID
  • Returns

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

    • ValueError: The parent id and the child id '{id}' cannot be the same.
      • parent_idchild_id가 동일할 경우 발생합니다.

Example

from mrx_link.sdk.utils import create_link_component, create_link_edge

# 코드 셀
code1 = """
x = 1
"""
code2 = """
print(f"{x=}, {y=}")
"""

if __name__ == "__main__":
    # 컴포넌트 생성
    component1 = create_link_component(identifier="111-1", name="test", code=code1)
    component2 = create_link_component(identifier="111-2", name="test2", code=code2)

    # 컴포넌트 연결 관계 생성
    edge1 = create_link_edge(parent_id="111-1", child_id="111-2")