The method create_link_parameter creates the class MRXLinkPipelineParameterModel, which contains information about pipeline parameters

Create Link Parameter

Create a pipeline parameter object.

create_link_parameter(name: str, value: Any = None) -> MRXLinkPipelineParameterModel
  • Parameters
    • name(str): Name of pipeline parameter
    • value(Any): Value of pipeline parameter

      📘

      • For the parameter Name, only Latin characters and numbers are available, and the name must begin with a Latin character.
      • For the parameter Value, only string, boolean, int, and float types are provided.
  • Returns
    • MRXLinkPipelineParameterModel
  • Troubleshooting
    • ValueError: The name of parameter '{name}' cannot be a python variable name
      • This occurs when a parameter name cannot be a Python variable name.
    • ValueError: The name of parameter '{name}' cannot be only contains underscore
      • This occurs when the parameter name consists only of '_'.
    • ValueError: The name of parameter name cannot be longer than 30
      • This occurs when the parameter name is longer than 30 characters.
    • ValueError: The value of the parameter cannot be longer than 300
      • This occurs when the parameter value is longer than 300 characters.
    • ValueError: The value of '{name}' should be in [bool, str, int, float]
      • This occurs when the parameter value is not a string, boolean, int, or float.

Example

from mrx_link.sdk.utils import create_link_parameter

if __name__ == "__main__":
    # Create pipeline parameters
    parameter1 = create_link_parameter(name="a", value=123)
    parameter2 = create_link_parameter(name="b", value="asdf")
    parameters = [parameter1, parameter2]