SDK Reference
Log In
SDK Reference

The method create_link_component creates the class MRXLinkComponentModel, which creates the components in the Link SDK.

Create Link component

Create a component. Components are the smallest units of a pipeline.

create_link_component(identifier: str = "", name: str = "", code: str = "") -> MRXLinkComponentModel
  • Parameters
    • identifier(str): ID of the component
    • name(str): Name of the component
    • code(str): Code of the component

      📘

      • name can contain English letters, numbers, and special characters.
      • code must be enclosed in three pairs of double quotation marks ("") as in the code example below.
      # Example of `code`
      code1 = """
      	x = 1 
      	print(x)
      """
      
  • Returns
    • MRXLinkComponentModel(id=identifier, name=name, code=code)
  • Troubleshooting
    • ValueError: Identifier is required.
      • This occurs when Component ID is not entered.
    • ValueError: Name is required.
      • This occurs when Component name is not entered.
    • ValueError: Component Name - '{name}' can only start with ['alphabets', 'numbers', '-', '_']
      • This occurs when the component name includes a character other than the alphabet, number, '-', or '_'.
    • ValueError: Component Name - '{name}' cannot be longer than 30
      • This occurs when the component name is longer than 30 characters.

Example

from mrx_link.sdk.utils import *

# Code cell
code1 = """
x = 1
"""

if __name__ == "__main__":
    # Create a component
    component1 = create_link_component(identifier="111-1", name="test", code=code1)