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 componentname
(str): Name of the componentcode
(str): Code of the componentname
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 '_
'.
- This occurs when the component name includes a character other than the alphabet, number, '
- ValueError: Component Name - '{name}' cannot be longer than 30
- This occurs when the component name is longer than 30 characters.
- ValueError: Identifier is required.
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)