Placeholder.Rd
A collection of Placeholder variables.
new()
Initialize Placeholder class
Placeholder$new(schema = NULL, name = NULL, type = NULL, parent = NULL)
schema
(dict, optional): Schema for the placeholder collection. (default: None)
Example below::
list(
'ModelName'=str,
'JobName'=str,
'Hyperparameters'= list(
'tol'=float)
)
Keyword Args:
name
(str, optional): Name of the placeholder variable. (default: None)
type
(type, optional): Type of the placeholder variable. (default: None)
parent
(Placeholder, optional): Parent variable for a placeholder variable. (default: None)
get()
Create a placeholder variable with an associated type.
Placeholder$get(name, type)
name
(str): Name of the placeholder variable.
type
(type): Type of the placeholder variable.
Placeholder: Placeholder variable.
get_schema_as_list()
Generate a schema for the placeholder collection as a R named list.
Placeholder$get_schema_as_list()
list: Placeholder collection schema.
get_schema_as_json()
Generate a schema for the placeholder collection as a JSON formatted string.
Placeholder$get_schema_as_json(pretty = FALSE)
pretty
(bool, optional): Boolean flag set to `True` if JSON string should be prettified. `False`, otherwise. (default: False)
str: JSON formatted string representation of the block.
contains()
Check if the placeholder collection contains the specified placeholder variable.
Placeholder$contains(placeholder)
placeholder
(Placeholder): Placeholder variable to search for, in the collection.
bool: `True` if placeholder variable was found in the collection. `False`, otherwise.
validate()
Validate a specified input against the placeholder collection schema.
Placeholder$validate(input = NULL)
input
(dict): Input to validate against the placeholder collection schema.
ValidationResult: Named tuple with the keys:
`valid` (Boolean): Representing the result of validation
`keys_missing` (list(str)): List of keys missing in the input
`keys_type_mismatch` (list(str), type, type): List of tuples with key name, expected type, and provided type.
to_jsonpath()
Returns a JSON path representation of the placeholder variable to be used for step parameters.
Placeholder$to_jsonpath()
str: JSON path representation of the placeholder variable
clone()
The objects of this class are cloneable with this method.
Placeholder$clone(deep = FALSE)
deep
Whether to make a deep clone.