|
|
|
|
@ -792,6 +792,13 @@ if you are not sure about the structure.
|
|
|
|
|
if not isinstance(parameter_value, str):
|
|
|
|
|
raise ValueError(f"Model Parameter {parameter_name} should be string.")
|
|
|
|
|
|
|
|
|
|
# validate options
|
|
|
|
|
if parameter_rule.options and parameter_value not in parameter_rule.options:
|
|
|
|
|
raise ValueError(f"Model Parameter {parameter_name} should be one of {parameter_rule.options}.")
|
|
|
|
|
elif parameter_rule.type == ParameterType.TEXT:
|
|
|
|
|
if not isinstance(parameter_value, str):
|
|
|
|
|
raise ValueError(f"Model Parameter {parameter_name} should be text.")
|
|
|
|
|
|
|
|
|
|
# validate options
|
|
|
|
|
if parameter_rule.options and parameter_value not in parameter_rule.options:
|
|
|
|
|
raise ValueError(f"Model Parameter {parameter_name} should be one of {parameter_rule.options}.")
|
|
|
|
|
|