The method create_link_pipeline
creates the class LinkPipeline
, which create pipelines in the Link SDK.
Create Link Pipeline
create_link_pipeline(
identifier: Optional[str] = None,
components: Optional[List[MRXLinkComponentModel]] = None,
edges: Optional[List[MRXLinkDagEdgeModel]] = None,
parameters: Optional[List[MRXLinkPipelineParameterModel]] = None,
) -> LinkPipeline
- Parameters
identifier
(str): ID of the pipelinecomponents
(list): Components of the pipeline (MRXLinkComponentModel)edges
(list): Edges of the pipeline (MRXLinkDagEdgeModel)parameters
(list): Pipeline parameters of the pipeline (MRXLinkPipelineParameterModel)
- Returns
LinkPipeline(identifier, components, edges, parameters)
- Troubleshooting
- RuntimeError: User configuration is required. For user configuration, try 'mrx-link login' in the command line interface.
- This occurs when user configuration is required.
- ConnectionError: Check your internet connection and try again.
- This occurs when there is an Internet request error or timeout.
- ValueError: Invalid email or product key. Please check your email and product key again.
- This occurs when the email or product key value is incorrect.
- ValueError: An unknown error occurred. If the problem continues, visit https://makinarocks-link.readme.io/discuss for discussion, or https://link.makinarocks.ai/technical_support/ for technical support.
- This occurs when an unknown error happens when connecting to the internet.
- ValueError: Pipeline parameter names should not be duplicated: ['name']
- This occurs when pipeline parameter names are duplicated.
- RuntimeError: User configuration is required. For user configuration, try 'mrx-link login' in the command line interface.
Example
from mrx_link.sdk.utils import *
# 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)
components = [component1, component2]
# Create edges
edge1 = create_link_edge(parent_id="111-1", child_id="111-2")
edges = [edge1]
# Create pipeline parameters
parameter1 = create_link_parameter(name="x", value="123")
parameter2 = create_link_parameter(name="y", value="baregasdv")
parameters = [parameter1, parameter2]
# Create pipeline
pipeline = create_link_pipeline(components=components, parameters=parameters, edges=edges)
# Print pipeline
pipeline.print()
Output
##### PIPELINE #####
ID Name Status Parent IDs
----- ------ -------- ------------
111-1 test Ready []
111-2 test2 Ready ['111-1']
##### PARAMETERS #####
Name Type Value
------ ------ -----------
x str "123"
y str "baregasdv"